What is 2 years of expenses?
If it is low enough, paying 10% penalty may not be so bad.
Absolutely this. Remember, no income for the two years means you will pay a very low tax rate (assuming reasonable expenses). You can likely withdraw, pay the penalty, and still come in well under a 15% net tax rate.
Why do this? A home equity loan or line of credit is likely to be 5% or less. That's less than the 10% penalty, plus deductible in the United States if you itemize. And you avoid the income tax on the money you take out of the 401(k).
If you're determined to do this before saving money in taxable accounts, get a HELOC. Pick one that has no costs to you up front, or math out the costs versus the interest rate you'll be charged. You only pay the interest on the amount you've borrowed, so long as it's borrowed.
Or start saving now and push your overage into an after-tax savings account or something similar, then take off when you've saved up 2 years' worth of expenses.
You are assuming the OP will never have ANY tax burden on the sheltered accounts. While this is a possibility visa via Go Curry Cracker, many simply do not have enough years left before SS to convert to Roth's. Not everyone has been planning for ER since age 22. Some (including the OP?) have been planning for a traditional retirement, hence have too many deferred assets at too late a time in life. At some point, the proverbial bullet must be bitten. If OP wants two years off now, without income, a 10 percent penalty is a minor tax burden vs paying interest on a variable rate home equity line (recency bias, rates will not stay low forever and CAPE is high suggesting lower 10 yr returns) for an indeterminate number of years AND having to pay a potentially higher tax rate on the deferred account later anyway.
More specifics r.e. "the plan" for OP are needed to optimize.
Not sure about this. A HELOC is at 4-5% right now. That's well below the 10% penalty, and it's not going over 10% in the next 4 years, which is presumably how long it would take OP to pay it off. His current 401(k) balance, while good, does not suggest he'd be forced beyond the 15% tax bracket until well into retirement (if at all), so paying a lower interest rate now (half--current HELOC rate versus 10% penalty) and deferring the potential 15-25% income tax 30 years or so is almost certainly a good call.
OP, if you make good money, fully intend to return to work in 2 years, and can pay off the amount you spend the next 2 years in the 2 working years following that, strongly consider getting a HELOC before your leave work (you need to show income!). You're taking a 5% loan to finance your two years off. In essence, you're just undoing the decision you made to pay off the house, with what is effectively a slightly higher mortgage rate.
Of course, if you have any doubt about your ability to return to work, make good pay, and pay off the 2 year balance quickly, then don't do that. But if so, you probably aren't in great position to take time off anyway unless you're willing to significantly defer your retirement when you return to work.