Good questions. Neither Korea nor Vietnam were (obviously) total victories. Korea was a stalemate and Vietnam was a loss. In the latter case politics played a huge part, as you noted.
My point is that the United States should have learned something from those conflicts. But evidently we have not. We still cannot conceive of being beaten. So there’s no need for caution on the international scene.
Napoleon had the same problem. And we all know where he ended up.
In terms of objectives Korea was a victory.
According to the head North VietNam dude, politics was THE reason for the U.S. ‘defeat’.