EVERY single nation on planet Earth has laws prohibiting murder. You are equating soldiers killing other soldiers on a battlefield as murder - that is not the accepted legal definition by any country or international accord.
No nation has laws making it legal for an enemy soldier to kill one of yours (even if most have laws making it legal for YOUR soldiers to kill ENEMY ones, and have international recognition for this asymmetry because everybody else wants to be allowed to legally commit murder, too). Formally, every battlefield killing is still murder. It just doesn't matter because prosecution is not customary/practicable.
Which is of course beside the point, because FACTUALLY it's always murder anyway, no matter what cowardly name you wish to hide it behind. But if we define murder specifically as an illegal taking of life (the textbook definition, alien to everyday use), then infantry combat amply meets that definition as well.
You could argue that the US's bombing of Hiroshema and Nagasaki was tantamount to murder; others will tell you that the US found it strategically necessary to end the war once and for all and that it would have caused even more loss of life to mount a traditional invasion campaign.
Legally, this would be irrelevant: if you murder a mass murderer, your crime is still dealt with under the heading "murder", and mitigating circumstances just apply within that reference frame.
(That is, unless you deal with the mass murderer from the position of the immediate and concrete next victim, in which case various self-defense formulations probably take precedence and your actions may be considered a different crime or, in special cases, not a crime at all. When two mass murderers slug it out with each other, as above, the legal battlefield will be equally bloody.)
You could even argue that drone strikes against terrorists in Afghanistan is murder, although I'd personally suggest that rules of the battlefield apply.
Again, there is no civil law establishing that rules of the battlefield overwrite civil law - except when it's
you yourself violating civil law, yours or theirs. If you declare martial law, it only makes it legal from your POV for you to slay your enemies, not for the enemy to slay you. It's purely a matter of might makes right in the end, with asymmetric concepts of right in mutual contradiction.
My memory is a little fuzzy, but what penalty (if any) was discussed in relation to the crimes of Kodos the Executioner from "The Conscience of the King"? 'cause that's probably Trek's only other precedent.
TOS was pretty consistent with this: no crime formally carried any sort of punishment.
When Lenore Karidian murders people, she is facing therapy. When Garth of Izar does, ditto. When Harry Mudd cheats and steals, ditto. And when Kodos is exposed, no punishment is suggested for his past actions (indeed McCoy ridicules the idea, even if Kirk thinks it may make the dead "rest easier").
Of course Kirk personally thinks he himself should murder Karidian. Or at least Kirk makes that explicit threat in the discussion with the mass murderer. But that's not the legal aspect of it, or the criminological, or even the practical.
(Interestingly, Kodos' actions amount to "butchering" and the like in hero dialogue, but were they a crime? Kodos
was the governor of the colony, even if only through a coup. We never quite learn whether he had the power to "sentence" - his own words - the 4,000 to death or not. Starfleet only has one death penalty in the books, its exact nature varying from year to year, but do civilian books have more of those? Or do the laws have clauses allowing for sentencing to death even when this is not a "penalty" for anything?)
There is a final bit on punishment and murder in "The Ultimate Computer" where Kirk claims to M-5 that the punishment for murder is death. But we know from elsewhere in TOS that it isn't, not factually. Perhaps Kirk is exploiting the fact that M-5 is really Richard Daystrom, and ca guess from the engineer's previous reactionary rantings that the two men share the illegal fantasy of punishing murder with counter-murder?
Timo Saloniemi