Changing the hashing functions, encryption, and network verification are all built into bitcoin. It's designed to be resilient, and to use consensus when adapting over time.
It'd be really stupid for people to go "oh no, someone cracked sha256 and mined a million blocks, I guess we're done with bitcoin now. Buh-bye money!"
They'll fix it in the case of a noticeable exploit. If someone were clever, they'd mine blocks surreptitiously, sufficiently spaced out over time and different networks so that it looks like normal mining. They could get a few blocks per day for maybe a couple years until the upgrades. The impact to the system would be minimal.
On top of that, most of the ecosystem is built on specialized hardware that is designed to compute sha256 specifically and that cannot be swapped.
The Bitcoin core devs have been thinking about the failure modes of hash algorithms since Satoshi. If you are betting against Bitcoin primarily because you believe it will fail when sha256 inevitably falls, you are missing the bigger picture and underestimating the resilience of the Bitcoin developers and broader community.
I feel like it would be slightly unethical but on the other hand you're not really defrauding anybody. You did actually produce those blocks, not by improving your calculator but by using some other method.
Have fun raking in those free bitcoins. https://keys.lol/bitcoin
My 10 years prediction is based on a heuristic, the constatation that a generation of cryptographic functions tend to last 20-30 years.