Almost every major company these days has policies about IP, prior inventions, moonlighting, etc. As such, it is very useful to speak to an employment attorney to know how enforceable those things are, and ways of getting them changed. I have done this and it has paid lots of dividends. This advice also comes in handy if you are ever laid off and face signing such things to get your severance payments.
In Australia that would be illegal, you don't have to sign anything to be laid off, and the company is legally obligated to pay out your severance.
I'd be very surprised if this wasn't the same in other countries.
They can of course ask, and pressure you to do so, but only a fool would sign something in order to get their legally entitled severance pay.
It is kind of the same here except that most employment is "at will" and there is no law stipulating minimum amount of severance other than maybe the two-week notice. As a result, when the company offers say, one week for every year you have worked, that is a "bonus" they are giving you and as such, can withhold it if they want. They hold this as a carrot to get you to sign the departure agreement.
Often they offer you some work to finish before leaving and this can come with increased pay/bonus. Again, this option is also withheld if you don't sign the agreement.
What is not well known is that you can negotiate these agreements if you have leverage with them, i.e. they really need you to finish your work. Or there is risk for them that you could sue for cause (discrimination, etc.). How clean their nose is in this being a real layoff determines how much willingness to negotiate.
You are right that employment laws are very different elsewhere. I had to shut down one of our R&D groups in UK and it was quite a complex process.
I have had companies try to get me to sign these things even when I am quitting! My answer is always a smile and saying, "if you want to pay me I will but otherwise, no."