What is the effect on GDP when foreigners buy lots of domestic bonds?
For every buyer there is a seller. If a foreigner buys a bond, that means a domestic investor sells it to them (or issuer). Why should the identity of who owns the bond matter?

In practice, there are many moving parts. One feature of financial crises is that investors buy U.S. Treasury bonds as a flight to safety. This means that purchases coincide with the weakening economy created by the financial crisis.