In my whole career I've always gotten my best salary increases by moving. If companies want to keep me around the way to do it is not with a modern form of slavery but rather by keeping me happy. If they have some stupid rule that says the max raise per year is 3% and I can get 8% somewhere else then fuck them.
But what do you know about the clients? Who at Company B needs to be handled with kid gloves? Who likes it when you're pushy? How much can you negotiate with Company C on the timeline? What are the strengths of the other developers both in house and at other firms?
That's the stuff you can only learn by working in the industry. That's what makes an employee valuable. That's the real skills, the stuff you won't learn in school.
In a profession, learning things like clients' preferences can be vital to performing a job effectively, but it's overly reductionist to call them "the real skills", even if that might be true in, say, a sales position.
So what? I learned some stuff from the company I worked for and they get the financial benefit for my creations long after I'm gone (at least potentially). I call that even (actually I already consider this advantage: company. I'd like to be getting residuals like people other industries do). If you don't want me to leave then make it attractive enough for me that I can't do so rationally.
They're about encouraging employers to make the investment in a new employee, knowing the time and effort put into that person isn't going to be easily transferred to a competitor.
That said, you can negotiate a non-compete, either doing away with it completely, or changing the terms.
Non-competes generally have at least three limiting features: industry, time, and region.
You can negotiate on the industry side: from "same industry" to "company's direct competitors".
You can negotiate on the region:"the Northeast" to "New England" to "metro Boston".
And you can negotiate on the time: twelve months, to six, to three.
I've just thought of this, but I think it would be fair it limit the non-competes based on the time worked in a position in a company. Less than one month and more than five years in a position, the non-compete clause goes away. Or the terms change.