Yes, that's probably a key difference between us. I would guess that I'm about half a year away (or less). If I were looking at a 2 year horizon or more and assuming a relatively high income, I'd definitely max my pre-tax allocations (I think I may still be able to do that this year as it is). Mega-backdoor contributions are post-tax though, so I wouldn't necessarily prioritize those. I don't know much about 401k loans, but that may be a reasonable approach if you need a boost and you anticipate being able to pay it back quickly. I would do the math and compare the results with simply putting post-tax retirement contributions into a high yield savings account.
I'm also a bit motivated to buy now while mortgage and inflation rates and are still so low, but then I don't want to get too caught up with market (mortgage) timing, so that's only a side consideration.
One thing I've been thinking about is riding a relatively small emergency fund if necessary due to 1) I am a relatively high earner in a stable job and could replace it quickly after the house purchase, 2) Once purchased, I may have access to HELOC funds as a replacement in the event of an emergency expense, 3) I have a small amount of retirement funds that I could liquidate against the 10% penalty if absolutely necessary, 4) if worst comes to worst, we could presumably get family support for a short term period or put it on a CC if the debt is small enough and we could pay it back before any interest hits. If we buy the house and then I lose my job, we'd be in trouble either way, so there isn't really much point hedging against that very rare possibility.