But you can also invoice the company you are working for, and then do the same in reverse, except it's usually you who do the conversion on the day you invoice them.
For long contracts, more than 6 months, I would definitely take into account the exchange rate. For shorter contracts, I wouldn't care. I'm from Norway, and none of the currencies I have worked "with" changes dramatically.
Maybe this is only an issue if you live in the EU or UK where dollars aren't as highly sought.
(I realize now that I‘m not actually sure how easy it is to get them as a consumer at a bank - alternatively you might be able to get them via Robinhood or similar.)
The FX risk cannot be magicked away.