In France, and I believe in many other places as well, you can't have a noncompete without proper compensation. Compensation is relative to how it will affect the former employee career, it is usually less than a full wage, but it can be that if it makes finding a new job particularly difficult.
There have been a trend at one time of bullshit noncompete clauses that were too broad and didn't come with compensation, these are not enforceable. If they tried to sue the employee (they don't), they would be laughed off by the judge.
What's the point of a law requiring it? Unless it's an addition to a minimum wage law and only in effect for those being paid the minimum wage...
Also the employer may have the option of not activating the noncompete clause when the employee leaves the company, meaning the employee is free and no compensation is due.