but can I not get out of this somehow if the period impacts on my
career prospects?
In many cases you can, but you have to be smart and constructive about it. If both parties agree to separate, than it doesn't matter what the contract says.
In this case, your career impact doesn't matter: you need a concession from the company so you need to understand what's best for the company and how they can get it. Let's look at it from there perspective: They have someone who wants out but you can force them to work for you for another three months. That's not an ideal situation: while most people are honorable and will deliver decent work it's unrealistic to expect the same level of productivity you get from someone who is passionate about the job and their career at the place. The likelihood that the exiting candidate will go "above or beyond" is very low.
There is also the risk than an exit candidate will become contagious: while you are still there, you talk to your colleagues and inevitably your departure will come up. If the reasons are real and the new opportunity is attractive, many of them may get second thoughts as well.
So it's typically in their best interest to get you out of there as quickly as possible with the added benefit that they don't have to pay you for the full three months of reduced productivity.
So when the time comes: keep your eyes and ears open: how do departures went down for other people? How quickly do they backfill, do they backfill during the notice period or do they just wait until the existing person is gone. Based on this you can always suggest a solution: For example: "I'm offering to leave as soon as you want me to without pay for the notice period, if you reduce the period to 4 weeks".