I still believe having a good relationship with your previous employers isn't the worst thing - I have at least a few that have said that if I'm ever in need of a job that they'd be glad to bring me back in. In unstable economic times that kind of relationship puts me at ease. Quitting without notice, which is what you're suggesting, is a great way to screw up that relationship.
Of course, if you're working somewhere that you'd never want to go back to under any circumstances, all bets are off.
This reminds me of something one of my previous employers did. They had hired a ton of new engineers straight out of college and gave them a couple weeks to relocate to the city, get apartments, etc. After about 2 weeks of their training, executives decided it was time for some layoffs. The main targets? Those new employees. Company severance policy was only based on tenure, so these people probably got $20 and were unemployed, with a brand new lease, in a city they didn't know (and frankly, one that isn't at the top of most peoples' lists to live in).
Notice periods are still a thing. And in many places outside of the US they aren't just a thing you do out of courtesy (sometimes much longer than 2 weeks too). And even notice periods didn't exist, what's stopping the company from laying off new hires anyway?
Notice periods are called extended breaks outside the USA. I've done them before and I put my feet up at my desk and let time pass. If you are a friend and worthwhile colleague then I will happily help you and my immediate team. I'm not there to screw up my teammates.
That stuff is just to scare you. In 25+ years, I've never NOT moonlighted. I did get a "talking to" by a VP once, earlier in my career, about having too many "outside business activities." His concerns were promptly ignored.