When I worked for US corporates I had to get a US ITIN, and then fill in some paperwork annually and/or at the start of each job. The paperwork (W8BEN, I think) told Accounting not to collect tax in the US, because the earnings would taxed in the UK under a reciprocal treaty.
The US is one of the very few countries to demand that US citizens pay tax to the US gov on all their earnings, and then pay tax again to whichever country they're resident in.
This tragic/hilarious asymmetry between ordinary citizens and corporations says a lot about the balance of power in the US.
The old loop hole used to be that if you were (Or intended to be) non-resident for 2 years or more you didn't owe taxes to Canada (you would need to do a deemed disposition of all your assets for tax purposes though). But then you couldn't vote either...
And keep in mind that the vast majority of countries have tax treaties with the US such that you'll get tax credits for foreign taxes paid. You'd only pay taxes in both countries if you're living somewhere with lower taxes than the US.