So there are 21 million total because that is how it was coded. Will it be possible to increase the supply or even make it infinite if someone was able to crack the code?
Theoretically, it is possible but It will take a hard fork to make this possible. Changing the total supply is not possible unless all miners and payment providers jointly upgrade their current Bitcoin system. This is not possible if the miner and the user do not agree to use the modified Bitcoin Code together. Current Bitcoin's block size is over ~330GB, which makes it even more difficult to change the core blockchain system. So technically it is harder than hard to modify the core system or manipulate the Bitcoin system. Every Hodlers and investors/miner will refuse to accept the newly modified code, everyone will try their best to keep alive the current version cause already they have invested in it.