Is there a halachic difference of a married women covering her hair in the presence of Jews or Gentiles? Even if you hold like the chasam sofer who says that it's Deoraisa?
Well if she's around Jews and uncovered hair is treated as ervah, then she'd be stopping any nearby Jews from praying or saying any brachos.
Generally it's assumed that the obligation of married women to cover is independent of the ervah status, so no it wouldn't make a difference.
The Gemara in Kesubos describes the prohibition as being "in public", and something like a courtyard (or in modern-day terms, walking from her apartment to another one inside the building) may not be "in public." But I'm not aware of any source distinguishing between Jews and non-Jews watching.