No it makes no difference. You are still giving it away to foreigners. If it's from a surplus then you should be saving it for a rainy day at home, not big noting yourself on the world stage making massive donations.
I am not against us giving some foreign aid...small amounts that are well targeted is a fine humanitarian thing to do. I suspect however that the large amounts our governments give away are poorly targeted and mostly benefit the elite of the recipient country.