You can completely dump the algorithm and render the attackers ineffective
This is possible in theory, but it was historically proven to be unsuccessful in practice. Each altcoin, which stopped using SHA-256, even though nobody broke this hash function, ended up in a worse position. For example: some developers wanted to stick with "1 CPU = 1 vote" principle, and changed the mining algorithm each time, when GPUs or ASICs were built for it. And of course, such coin could work, and provide some level of security, but it would be much worse than Bitcoin. Meanwhile, altcoins, which maintained a fraction of BTCs hashrate, but stayed with SHA-256, were much more successful.
and in billions of losses in assets
I am not so sure about that. If there are many devices in use, which can mine a given coin, in a given way, then it will often find a group of people, which would do that. All new features and upgrades have to be backward-compatible, at least to some extent, otherwise they will be just altcoins. And many users can simply reject new version, and stay with the old one, as long as it is not fully broken. Which means, that if transactions can be processed, then many miners will keep mining even highly-centralized chains, as long as they will be worth some money. In practice, chains can die, if there are exactly zero users, otherwise they can be kept alive as long as needed.
Do not expect a solution of a kind that is not possible for computers.
Sidechains can provide additional revenue for miners, but decentralized ones were rejected, so we have only some centralized federations, like RSK or Liquid, which are still very far from reaching the full potential. Currently, Bitcoin is harder and harder to change, and soon, it can reach a point of being unchangeable, which is called as "ossification" by some people. And then, the only new changes will be completely outside of consensus rules, and will happen only in second layers and subnetworks, because nobody would successfully reach any consensus for changing the main layer anymore.