Yes, it took decades, but in Australia our various states have worked through the "it's criminal" -> "It's criminal but not enforced" -> "we're deliberately vague and won't prosecute doctors" -> "we have a legal framework that makes abortion legal up to {20,22,24} weeks on demand, after which it requires the consensus of two independent medical opinions".
The US needs to do the same. Yes, it will take decades. No, it shouldn't because abortion is a medical procedure, but religion is a scourge.
How do you reconcile your 'nakedly partisan' theory with the court rulings that, for example, overruled Trumps attempt to use the AEA for immigration enforcement, overruled his attempt to deploy the National Guard without the consent of state governments, overruled his attempts to unilaterally impose tariffs, overruled his attempt to restrict birthright citizenship, and so on?
Things like birthright citizenship are a good example of that latter concept: the law is extremely clear there so they ruled against him because the only alternative would be declaring outright that the President is not bound by the constitution, but in many other cases they’ve made quite unusual actions to preempt lower courts before either finding a new executive power or, where the law is clear, stalling to allow things like deportations to proceed in the interim before ruling against.