Maybe I'm playing semantic games, but I think words like "extrajudicial" hint at a solution to the paradox of how a political system can address existential threats.

A political system encompasses both a legal process and a system of allocating power. Extrajudicial means not authorized, but it doesn't imply the power exercised was illegitimate. Rather, it suggests the power was legitimate. Contrast that with a murderer, who never possessed any legitimate power to take a life, let alone take one according to some legal right. Cold comfort but in principle a meaningful distinction, especially if you agree that power is principally defined and circumscribed by the office, and only secondarily by the rules for executing that office.

For the sake of argument, let's say the drug scourge was truly an immediate and existential threat to the Philippine polity. Duterte's mistake wasn't to unleash vigilante death squads, it was to admit to and purport to authorize the death squads. If he had (1) quietly unleashed the death squads, (2) creating plausible deniability and permitting the existence of the fiction that the state wasn't involved, and crucially (3) left himself and the vigilantes exposed in principal to punishment for exercising power without legal right, then there would have been no substantial injury to the rule of law.

It's like civil disobedience--it nominally violates the law but as long as you're willing to accept the legal consequences the rule of law isn't injured. You're putting yourself at the mercy of the law in service to the law.

It's why I absolutely opposed the Bush-era and Obama-era strategies to "legalize" various tactics in the War on Terror, and would have preferred the status quo ante where the president exercised unchecked powers. Both Bush (notwithstanding "Unitary Executive" advisers) and Obama argued Congressional authorization made the executive more accountable. But it made the executive less accountable because now it had both the power (slightly diminished, maybe) and the legal right where once it only had the power. Legalization corrupted our law and our morality by authorizing behaviors that should never be authorized, merely tolerated as a practical matter.

Previously, as long as both Congress and the People believed an exigency legitimate they had the option of looking the other way, especially if the President never admitted it and maintained enough restraint to maintain the polite fiction. By leaving themselves exposed to punishment the President and his agents are incentivized to restrain themselves and as a practical matter limited to exercising their powers in situations and in a manner that doesn't openly flout the rule of law--in other words, precisely those contexts where the rule of law is already inoperable or under existential threat.

As with civil disobedience, however, the solution to the paradox requires selflessness and credible risk of self-sacrifice. The existence of such leadership seems as scare as it ever has been.

The parallels with Socrates' trial and death are not coincidental, though it was by putting together the above theory that led me to a fuller understanding (I think) and greater appreciation of the story.

How might this work with El Chapo, presuming reasonable necessity? From a position of legitimate power (President, General), arrange and permit his extrajudicial assassination by an otherwise respectable citizen (i.e. not a rival, though perhaps a victim if public sympathy is important) willing to face public prosecution (not to mention cartel reprisal) for the promise (not guarantee) of a commuted sentence. It's risky--how do you know when the rule of law is existentially threatened, or that an act is reasonably necessary in defense?
But at least the risk of punishment faced by all parties serves to sharpen judgement and, if necessary, is available to remedy any harm to the rule of law if the judgement was in fact mistaken. Moreover, at least in the West sentencing rules typically mandate proportionality (a function of moral culpability, among other things)[1], and while extrajudicial acts could easily mandate swift and severe punishment, in principle leniency is also permitted so judgment needn't be flawless.

[1] Mandatory minimums are, strictly speaking, unconstitutional at the U.S. Federal level as SCOTUS has declared sentencing ultimately the peculiar purview of the trial court, recognizing that proportionality necessarily requires one to account for the innumerable facts and context of the case in a way impossible to accomplish a priori. Mandatory sentencing is a legal contradiction, at least from the perspective of Western morality.