1040-NR is an income tax form, and has basically nothing to do with Social Security and Medicare taxes, which are payroll taxes rather than income tax. They do show up onninckme tax forms when paid as self-employment (including the 1040-NR, where presumably they would not appear if they did not apply to nonresident aliens.)
> As a non-resident alien, you're not required to pay social security and medicare.
Incorrect, from the IRS: “Wages paid to nonresident aliens employed within the United States by an American or foreign employer, in general, are subject to Social Security/Medicare taxes for services performed by them within the United States” [1]
[1] from https://www.irs.gov/individuals/international-taxpayers/alie... which also provides details of the exceptions that apply to certain work in certain non-immigrant visa categories.
If you're going to exploit foreigners, at least tax them accordingly. Or, offer these skilled immigrants a reasonable path to residency, and tax them like citizens.