Have there already been posts about this?
We have an ESPP and have been letting funds sit in it bc the stock is growing well. However now we are looking to move funds out - specifically to cover a large purchase we're making. I plan to simply do the math on lower taxes for all the "long term" shares vs higher tax on newer shares that have not had time to grow much yet. From just eyeballing it, it looks like selling the newer shares will have us paying the least tax.
Any other more complicated maths I need to think about before pulling the trigger?
You'll have to pay tax on all of it in the end, so selling whatever has the lowest tax rate first is the mathematically efficient decision if you plan on leaving some in the plan.
This may be complicated depending on specifics like if it pushes you to a higher tax bracket, you're going to have a super low income year when you plan on selling, you want to spread it over multiple years, etc, but in general selling the old long term gains stuff first is the right call, even though it ends with "more" taxes in the short term.
Basically if you sell the new stuff now, your old stuff will just gain more, and in the future have even more taxes to pay on it. In the meantime you will have paid a higher rate on your gains from the new stuff. You'll end up with the exact same amount of value regardless of which shares you cash out first, just in one case you're paying short term (high) capital gains on some of it.