You need to repeat the Serenity Prayer. One cannot optimize with the many uncertainties in ones financial life. Such as unknown date of death, inflation rates, investment returns, tax changes, etc. All one can do is take their best guess based on available information and their risk tolerance.
I'm guessing here, but I think OP may be frustrated - as I am - that even if you accept the above about future uncertainties, it's still pretty darn difficult to calculate an optimal path forward.
That is, even if I accept those uncertainties, give up on knowing the future, and insert point estimates, or probabilities, or ranges, the math required to build a model of even a moderate tax return over the next decade or so is very challenging.
I tried it once for my own case for five years, making a lot of simplifying assumptions about the tax code, and it ended up being about 300 or 400 rows in Excel. That included all the necessary tables and lookup values in addition to my particular lines on my particular tax return. And I ended up identifying several bugs in my implementation over time that made me doubt the resulting model.
So what I've ended up doing, OP, is giving up on trying to "maximize to optimum" and have settled for a lower standard of somewhere between "obviously not stupid" and "probably a good idea". In giving up, I won't ever know to what extent the choices I end up making were suboptimal - and this can be considered a feature rather than a bug.
Thankfully I'm at a point where that lowering of my standards won't really affect my life. I have multiple times enough for me. The only impact is that my kids will likely inherit some degree of suboptimal dollars instead of some larger number. But they already have a lot and will likely inherit a lot as well, and they'll probably never realize or care that it could have been a bit or a lot more.
Perhaps some day in the future I'll take another crack at it and maybe I'll succeed then.