In order to fully compromise your privacy, the government would need to have control of _all nodes_ in your path, not just the entrance and exit nodes. (They _might_ be able to deanonymize some users by using traffic correlation using only entrance and exit nodes, but that is by no means a straightforward process.)
Tor also gives you a way to choose a specific exit node based on the country it is in, but I have no idea how reliable that is.
It is worth noting that with hidden services no exit nodes are required, since your traffic's final destination is running its own Tor-compatible node.