Uh, I'm not an economist, but what you said doesn't make much sense to me -- isn't "the market clearing price" effectively the same as "people are paid the value of their work"? If the value that a software engineer can potentially produce is lower, then wouldn't the corresponding market clearing price would simply be lower for that person?
Maybe in a world where every software engineer is genetically engineered to have the same output then what you said about market efficiency would make sense, but this isn't that world.
The thing you said about price discrimination is not even related to what the OP said, and you simplified the problem a lot by reducing the problem simple monetary terms. The example you gave about expats is particularly flawed, because it's not unusual that expats are paid more for other values that they bring outside of the work they perform (for instance, academic institutions think of that as prestige in some Asian countries). We were all born unequal, if the market were so efficient there wouldn't be so many unjust things happening around the world.
No, since there is no good way to measure how much a person's individual work is worth (in software engineering). There are ways to do that in finance and sales - that's why the pay bands for those fields are so much wider.
I think the reality is the best engineers are probably worth on the order of multiple millions per year or more (assuming they are working at a place with leverage), and the average engineer is probably worth much less than they are making now. That's the power law we see with YouTube creators, for example. If people had reliable ways of identifying who is actually a really high performer, the pay bands might look more like that. The pay smoothing (since it's hard to make an accurate measurement of efficiency) actually benefits the average engineer over the super high performers.
Maybe in a world where every software engineer is genetically engineered to have the same output then what you said about market efficiency would make sense, but this isn't that world.
The thing you said about price discrimination is not even related to what the OP said, and you simplified the problem a lot by reducing the problem simple monetary terms. The example you gave about expats is particularly flawed, because it's not unusual that expats are paid more for other values that they bring outside of the work they perform (for instance, academic institutions think of that as prestige in some Asian countries). We were all born unequal, if the market were so efficient there wouldn't be so many unjust things happening around the world.