Why on earth does the mining have to use more power than a medium size country as the price rises?
Because the miners get paid with block rewards in bitcoin. As the price of bitcoin rises so does the block reward.
And as long the mining gear produces more rewards than the power to run it costs, it will stay online. And at, say $500K per coin and 12.5BTC/block that would be like $900M rewards/day or ~$330B/year. A large amount of that would be going into paying the electricity bills.
You make an excellent point and in the long run perhaps the mining system may prove flawed.
But I must have missed where in the near term the cost of a bitcoin is anyway related its mining cost?
I'm sorry, but you are wrong.
If bitcoin price is 10x higher than mining costs then a lot of new miners will emerge ... simply because they can make some profit.
If the price of bitcoin rises 100x tomorrow the mining cost of a bitcoin in the near term does not. The mining cost will rise as demand for miners rises to capture profit from the block reward minus cost of production, but this is a delayed response, with a definite lag period.
My point was simply that in for example november/december last year the price shot up 10x in very short order. Mining has since surged to capture that demand and the hash rate has gone ballistic.
In this example with a bitcoin valued at 500,000 dollars, however unlikely it seems, such a price could arise in a bubble situation where the price rises many fold over a short period of time, far exceeding the pre bubble mining cost of securing the network. So although I doubt we will ever see such high prices they do not necessarily require the hundreds of billions of dollars in electricity costs that goat has inferred earlier. Sustaining such a price is a different matter entirely..