The most common way consultants and contractors avoid paying US taxes is to set up a corporation in a country that doesn’t tax foreign income and then do all work through that company. If the income never becomes personal income of a US citizen then it is never taxable in the US. While you must disclose the ownership of the foreign entity, under certain circumstances, you do not need to report any income of that entity outside the US since neither the company nor the source of the income fall within the jurisdiction of the US. As long as the entity is not a pass-through entity. (Which it isn’t because it’s a foreign corporation.) The corporate income is independent of your income and you never have to report it. In fact you can’t because it’s not your income.
Now since since you are the sole shareholder of the corporation you are free to do whatever you want with the funds in that company as long as you follow the rules of the country that the corporation exists in. Since you were smart about the country you set up the company in they have lax or no rules about what corporate funds can be spent on. Your company can own your home, pay for your car, pay for your meals and entertainment etc. and while normally you would be required to report that as income if you are living/working in third country all of those are considered direct business expenses even by the IRS (If there was even a way to report it but there isn’t because again all this takes place outside the US) and therefor naturally paid by the company.
Typically the way these get set up are by consulting companies that either handle it directly for their consultants through their expat outsourcing group or through third parties that handle it all for the individual for a couple thousand dollars and a yearly maintenance fee. Records still have to be kept and business registrations handled so that is what they are there for. For the consultant, you just pay for everything with corporate checks or credit cards and withdraw cash using a corporate ATM card when you need it. Typically those cash withdrawals will be the only thing that is reported as “income” but you can avoid this too by keeping receipts and ensuring you file them as corporate expenses. Typically there will be a few hundred dollars of cash receipts that you lose or forget to send in so will get a W2 but you will be way below the standard deduction.
What most consultants do is is set up a US based entity and do a double contract through the US entity. This allows them to repatriate the full standard deduction amount plus the max 401k deduction amount into the US without paying taxes by having the consulted pay the foreign company which pays the US company, which then maintains the 401k and pays the consultant.
Even after the consultancy ends and you return to the US all of this remains in place and functions no differently for as long as you need it to. The consultant still owns the company has free access to the money and can slowly repatriate money at their discretion.
If you ever encounter someone whose home is owned by a foreign entity that they control this is very likely the reason why.
This is all a fairly common practice for overseas consultants. I was first introduced to this over 20 years ago by an Australian company consulting in the UK. It seems really shady at first but ultimately you are playing within the rules and following the law in every country involved. I’ve even been audit by the IRS shortly after then and it was not an issue.