The Rambam writes (Hilkhos Melachim 10:12):
אַפִלּוּ הַגּוֹיִים צִוּוּ חֲכָמִים לְבַקַּר חוֹלֵיהֶם, וְלִקְבֹּר מֵתֵיהֶם עִם מֵתֵי יִשְׂרָאֵל, וּלְפַרְנַס עֲנִיֵּיהֶם בִּכְלַל
עֲנִיֵּי יִשְׂרָאֵל, מִפְּנֵי דַּרְכֵּי שָׁלוֹם: הֲרֵי נֶאֱמָר
“טוֹב-ה’ לַכֹּל; וְרַחֲמָיו, עַל-כָּל-מַעֲשָׂיו” (תהילים קמה:ט),
וְנֶאֱמָר “דְּרָכֶיהָ דַרְכֵי-נֹעַם; וְכָל-נְתִיבוֹתֶיהָ שָׁלוֹם”
(משלי ג:יז).
[Not only Jews and geirei toshav (resident aliens),] even for non-Jews our sages commanded to visit their sick, bury their dead [as]
with the Jewish dead, support their poor among the Jewish poor,
because of darkhei Shalom. For it says, “Hashem is good to all, and
His Mercy is on all that He made.” (Tehillim 145 “Ashrei” v. 9). And
it says, “[The Torah]’s ways are ways of pleasantness, and all its
paths are peace.” (Mishlei 3:14, also said when returning the Torah to
the aron)
Rav Aharon Lichtinstein zt"l points out that the Rambam's prooftext
for "darkhei Shalom" are about (1) imitating G-d, and (2) that the
authentic ways of the Torah are to be pleasant and advance peace. It
would seem that the common understanding of Darkhei Shalom is wrong.
Rather, we express our concern toward non-Jews for the sake of
remaining on the path of peace, because that is Hashem's Path.
(Compare the list of examples the Rambam gives here with the list of
kindnesses the Talmud [Sotah 14a] shows us examples in the Torah of
Hashem doing.) Not pragmatics or PC, but a fundamental part of the
ideal.
Rav Lichtenstein translated the relevant snippet of a responsum by the
Rama (#11) to show that peace in-and-of-itself, without any
implications of future danger, is sufficient reason to override some
prohibitions:
We have learned from here that it is permissible to modify [the truth] for the sake of peace, and it is permissible to violate the
injunction, “Thou shalt distance thyself from falsehood.” [The
consideration of peace] also overrides the biblical prohibition of
“Thou shalt not do thus to the Lord thy God,” which bans the erasure
of God’s Name, as is explained in the Sifri to Parashat Re’eh and
counted by the Rambam and the Semag in their respective enumerations
of the mitsvot. Since this is so, I say that it is also the case that
[peace] overrides the prohibition of defamation; in other words, it is
permissible to defame another if one’s intention is for the sake of
Heaven and for a good cause, [namely,] to promote peace.
(The above is based on an email from Yeshivat Har Etzion from decades
ago that I could not find a copy. However, it is very similar to Rav
Aharon Lichstein's article “In The Human and Social Factor in
Halakhah”, Tradition 6 (2002) pp. 89-114, made available on-line
by the Lookstein Center for Jewish Education at Bar Ilan Univ.)
A similar idiom that is also commonly understood on pragmatic grounds
is "mishum eivah -- because of enmity", usually explained as reason
to permit something because the enmity likely caused by observing the
prohibition may pose a threat. neither idiom is used not used
exclusively where there is real risk to life or limb, but that would
have to be the meaning of the phrase if it were pragmatic grounds to
override Shabbos. Mishum eiva is applied between father and child
on Bava Metzia 12a; on Yuma 12b to the kohein gadol; and on Kesuvos
58b, between husband and wife. So avoiding eivah is a value of some
sort detached from the value of saving people from future retaliation.
But we were looking at darkhei Shalom in particular.
There is a story in the gemara (Sukkah 53a) where David haMelekh
dug deep holes into the ground as part of his preparations for the
future building of the Beis haMiqdash. He dug far enough down to hit
the tehom, the subterranean water, and the water came up threatening
to drown the world. Achitofel wrote the name of G-d on a pot sherd and
through it down the hole, thus stopping the water. He reasoned from
the law of sotah, where a paragraph of the Torah that includes
Hashem’s name is written on a parchment, dissolved in water (along
with some dust from under the Beis haMiqdash) and given to a sotah
— a married woman accused of adultery who then is found alone with the
suspected paramour. Achitofel reasoned that if Hashem’s name may be
erased to save one marriage, then of course it may be erased to save
the entire world.
So, darkhei Shalom and mishum eivah are in reality expressions
about advancing world peace and global harmony, and as per the above
Rambam, imply a responsibility of Jews toward the welfare of non-Jews.