None of the U.S. examples would've been a big deal. You're gradually investing, not adding a huge lump sum at once. In fact, the top of 2007 would be good, because you'd continue to invest during the 2008 crash then recover everything else plus a lot more in a few years.
Japan has been a different beast. We haven't seen anything like that in the U.S. since the Great Depression. Technically, it took 25 years or so to recover from the Depression, but dividends were higher then, so if you reinvested dividends, you recovered a good bit faster.
https://investment-fiduciary.com/20...our-retirment-in-a-recession-even-depression/
But again, in a 401k, you'd be investing as the market dropped 40, 50 and up to almost 90%, then getting the gains on the way back up. They weren't around in the Depression, though.