It is an interesting question. If you live to 72, the government will force you to start taking minimum distributions from your 401k, which, depending on your balance, could be large enough to trigger significant taxes.
To truly optimize, there would, one expects, be some point after which you should stop maximizing contributions to the 401k in favor of regular after tax accounts. I agree that it would probably never make sense to leave any employer match on the table, but there may well be some scenarios where you might not want to maximize your contributions.
I guess what it comes down to is your current tax rate, which you would pay on money that you did not contribute to the 401k, compared to the expected tax rate you will have to pay on any RMD (required minimum distribution) when you reach 72 and have to start taking them even if you don't need that amount to support your lifestyle. You would have to look at how many years you might be able to draw down the 401k in a tax advantaged way (conversions to Roth pipeline at a rate that keeps your cap gains taxes low or zero) which would probably at best offset gains in the account (let's hope).
I think it was mentioned in the thread that there is the more obvious reason you might stop contributing to the 401k, which is that if you retire early and need to fund your lifestyle for a few years before you can get to your 401k funds without penalty (a Roth pipeline which takes 5 years to work). If you don't already have the money to support yourself for those 5 years, you need to save that up in non-retirement accounts, which may require redirecting the money you would otherwise contribute to the 401k.