Produce it on your own time, using no company resources. If a company claims ownership of everything you produce in your own time using your own resources, you've signed the worst contract possible and the company should go out of business. Most of the time, they claim things you make using their resources or company time. Avoiding that avoids most issues.
Anecdotal, but most companies I've worked for have policies that claim ownership of everything I produced in my own time on my own equipment. I think that's the rule, not the exception.
That would be difficult for people who work for companies that claim presumptive ownership over everything they produce.