At the same time you can negotiate a shorter notice period. Both airlines I’ve left I’ve been given shorter notice than my official notice periods. I was open with my managers and asked them if they were willing to consider shorter than I was contractually obliged to honour. Both times my managers were happy to let me go early. I guess it depends on how you approach it.
Conversely (Under EU law) anything over one month could be considered a restrictive practice and against the principles of freedom of movement. I wouldn’t want to be the one to test it though.