I think an copyright/IP assignment contract is standard in many or most U.S. software jobs, at least when working for a big enough company that they have a lawyer who handles the NDA/employment paperwork.
That pretty much automatically rules out over employment because you can’t separately promise two different companies that you’re assigning all software copyrights to them rather than you, it’s an incompatible contract (even if it’s limited to work hours - you’re pretending to both companies that you’re working 9-5 solely for them).
You can do anything - the question is whether you'll get caught and then whether you'll get punished. Does the employer have anything to gain by suing the employee in these cases?
All successful big tech businesses - all of them - got that way by openly breaking laws. They don't trigger automatically, but upon a manual review, triggered by someone with at least a couple grand to spend on the endeavour. A lot flies under the radar in practice.
A large percentage of U.S. software jobs (and probably nearly all YCombinator startups) are in California. Other states might be different, but stuff you do outside of work doesn't automatically become your employer's IP in California.
There are some nuances and I'm not a lawyer, but the gist of it is that three ways to trigger the IP to attach to your employer:
1. You do it on-prem or during work hours (but work hours are flexible for salaried employees)
2. You do it using company equipment (say, company laptop at home)
3. It's reasonably related to what you or other people do at your day job
If none of those apply, then you own it. That's relevant to the discussion at hand because, at least in California, you could work from home for two companies with unrelated businesses and not break any rules.