The per curiam opinion in Goldwater v. Carter was simply that the case was sent back to the lower court with instructions to dismiss the case. This opinion was issued without hearing oral argument from either side.
As far as I can tell, that was it; the per curiam opinion contained no other controlling precedent. This is because SCOTUS ended up being badly fragmented on the question. Drawing on this
video explaining Goldwater v. Carter (via Quimbee), here's how it broke down:
Rehnquist, in his concurrence (joined by Burger, Stewart, and Stevens), argued that the question was inherently political because the Constitution did not directly address how treaties should be terminated.
Powell, in his concurrence, argued that the case should be dismissed as not yet ripe for judicial review. For a case involving inter-branch conflict to be ripe, he argued, both branches must take an official action concerning the matter in question; and when Goldwater and the other senators brought the case, Congress had not actually taken any action concerning the Taiwan treaty. However, he noted that if Congress had done something to express its official position on the matter (a vote or the like), then the case would have been decidable by the court.
Marshall simply concurred in the result and did not join either of the concurrences or write his own concurrence.
Brennan dissented. He thought that the case could have been decided as an ordinary constitutional question, since it involved which branch of the government had certain powers. He then analyzed the merits of the case, and found that since the President had the authority to recognize foreign countries (as part of conducting foreign policy), and that this treaty withdrawal was part of Carter's efforts to recognize the PRC, he had the authority to withdraw from the treaty.
Blackmun & White also dissented, simply saying "we should hear oral arguments on this case".
In the case of a hypothetical withdrawal from NATO, the Rehnquist concurrence would still argue that the question was inherently political and couldn't be decided. The Powell concurrence would argue that since Congress has expressed its views on the matter (via passage of 22 USC ยง 1928f), the question could be decided by SCOTUS (though Powell himself did not reach the merits of the question). And the Brennan dissent would not directly apply, since it would not involve recognition or non-recognition of a foreign state.