And if a government tried to attack Bitcoin, wouldn't it be extremely likely that they will be exposed? How could you pull off such a massive operation, whether it be hardware orders or electricity going through the roof at a specific geolocation, or anyone else involved in the operation saying a single word, the government/actor trying it would almost certainly be exposed.
They can succeed but in a short period only. The Bitcoin community will detect their attacks and react quickly to stop governmental attacks.
Is there any way to roughly identify the geolocation of the hashrate production through means other than whistleblowing or obvious behavior like huge hardware orders?
Geolocations don't mean they are identities of ownership. In same geolocations, you can find different mining companies and their hash rates belong to different owners.
Full nodes can detect IP address as I know. I read some documents that in order to have better privacy for your bitcoin transactions, you should set up your Bitcoin full nodes and broadcast your transactions from your full nodes.