The incentives ensure that it will happen with zero intent, and probably without the people doing it even realize they're doing it. It's not illegal to see someone, think of them as a 'sucker' but not even realize why, then lowball them, which is far more likely than for a person to actually consciously confront themselves they may be a racist.
In any case, even if they know it's illegal, it's not so easy to enforce, the fact that people get successfully sued or jailed a small fraction of the time isn't going to be some solace.
The only way to actually solve it is to remove the incentive in place, namely either the market pressure to get the best developer at the cheapest price or the vulnerability of being an immigrant.
This is precisely what HR and hiring managers at FAANG companies are instructed and trained to avoid.
1) Hiring manager to have incentive to hire quality talent at the most economical price
2) Foreign talent be more desperate than domestic talent
The effect is practically guaranteed even if there is exactly zero intent by the hiring manager or any conscious 'discrimination.' Incentives beget results and people may not ponder how they got there, and they often don't.
Unless you change (1) or (2) all the discrimination legislation, lawsuits, and 'training' in the world isn't worth the paper it is written on.