Yes exactly. Sometimes they ask you if you can negotiate with your employer to shorten this period, which is often the case.
Of course, they would rather it was shorter, but hiring is already a multi-months long process in most cases, so a few more months is inconvenient, but not the end of the world. If you need someone now, you hire contractors.
You would have to prove cause to fire without notice.
Also, depending on the country, firing/layoffs can be difficult without cause (and often even with cause) (e.g. you can't layoff someone at will, you might need to prove that you have an economic downturn before downsizing). But this varies way more between countries as far as I know.
That was my thought. It's typical in Canada that an employer will pay you out for the rest if your two weeks or whatever, and in the U.S I don't know, but have it really favours the business. I'm still at abloss as to how this works in what is apparently most of Europe. Notice is more like 2 or 3 weeks.
Of course, they would rather it was shorter, but hiring is already a multi-months long process in most cases, so a few more months is inconvenient, but not the end of the world. If you need someone now, you hire contractors.