Even if you think it is unenforceable and even if you have piles of similar cases that were thrown out of court in similar situations, there is still a chance that the court won't throw out your case -- because of some small detail that you didn't notice.
Don't sign stuff if you don't agree with it. It is a risk -- and potentially a very big risk. Even if you happen to win your argument, if the case goes to court, you are on the hook for a large pile of cash. And there is no guarantee that the process will be quick. Your opposition can play any number of underhanded tricks to drag the whole thing out as long as possible, knowing that you can't pay for a lawyer forever. Even if you are able to get get that money back eventually, you may be in for some incredibly rough times in the interim.
When I've had to (because I needed the job), I've signed inventions agreements, non-compete clauses, etc. An inventions agreement basically means that I'll be using your company as a staging point while I look for a non-crappy job. I'll be out of there as soon as I find something better. A non-compete means that you have to pay me for my time. If you have a 1 year non-compete, and I intend to work for you for 3 years, then I want 33% more money than I would ask for someone without a non-compete agreement. I will then use that time to write free software (and, if you can believe it, I literally did that once).
But usually you have a lot more leverage when you are hired than most people think. It's expensive to hire people -- maybe not so bad for juniors, but once you've got 10 years or so under your belt it's a major investment in time, money and energy to hire you. If the legal department cock it up, then they will have hell to pay from the other departments.
Negotiate your contract! I can't stress that enough. Again, there will be times in your life where you have to take what you can get, but weigh your options and make the decision that's good for you. Most of the time, though, this won't be your only opportunity for a job, whereas this is the only opportunity they have to hire you. Use that fact to your advantage.
Don't sign stuff if you don't agree with it. It is a risk -- and potentially a very big risk. Even if you happen to win your argument, if the case goes to court, you are on the hook for a large pile of cash. And there is no guarantee that the process will be quick. Your opposition can play any number of underhanded tricks to drag the whole thing out as long as possible, knowing that you can't pay for a lawyer forever. Even if you are able to get get that money back eventually, you may be in for some incredibly rough times in the interim.
When I've had to (because I needed the job), I've signed inventions agreements, non-compete clauses, etc. An inventions agreement basically means that I'll be using your company as a staging point while I look for a non-crappy job. I'll be out of there as soon as I find something better. A non-compete means that you have to pay me for my time. If you have a 1 year non-compete, and I intend to work for you for 3 years, then I want 33% more money than I would ask for someone without a non-compete agreement. I will then use that time to write free software (and, if you can believe it, I literally did that once).
But usually you have a lot more leverage when you are hired than most people think. It's expensive to hire people -- maybe not so bad for juniors, but once you've got 10 years or so under your belt it's a major investment in time, money and energy to hire you. If the legal department cock it up, then they will have hell to pay from the other departments.
Negotiate your contract! I can't stress that enough. Again, there will be times in your life where you have to take what you can get, but weigh your options and make the decision that's good for you. Most of the time, though, this won't be your only opportunity for a job, whereas this is the only opportunity they have to hire you. Use that fact to your advantage.