Since getting rid of all military in the world sounds utopian at this moment, UN can take a first step in this direction by asking its member countries to change military oath in their countries. Soldiers take oath to protect their countries on their soil, but are not obligated to participate in wars in foreign lands even if it sounds by politicians as "protecting motherland"
From an idealistic perspective: I mistrust any "hack" that would prevent taking out Nazi Germany.<p>From a more cynical perspective: Who's going to have to actually change the oaths? The politicians. The same politicians who want to be able to sell the wars as protecting the motherland. That change seems to be unlikely to be implemented, because it takes power away from those who want it.