You don't. The unwritten assumption or meme I keep hearing from the community (not necessarily here on HN) is that if you're good, you'll just keep turning down jobs with such clauses until you get an offer from somewhere without such clauses. Otherwise, too bad: you're not talented, passionate, 10x, or whatever enough. Sigh. Sucks to be tied down to a state that does enforce and seems to encourage those clauses.
I think the other way to look at it is trying to gradually engineer scenarios where you do have that flexibility to walk / take another offer.
Everyone is going to have at least one point in their life where they need to take job X because Y. But you can do things to make that the exception rather than the rule, even if you don't feel you're a wunderkind.
Continual job searching, self marketing, networking, skill refresh towards emerging areas. These all give you better odds to be on the right side of that discussion than the wrong one.