The reported murder of the half-brother of Kim Jong-un by two female secret agents fits well into the unreal, comic book depiction of North Korea as bizarre hermit kingdom ruled by a murderous, whimsical, paranoid and overweight tyrant addicted to chocolate and cocaine. But Kim’s dictatorship is no joke.

Ever fearful of plots to overthrow him, Kim is said to have had 140 senior officials executed since he succeeded his father, Kim Jong-il, in 2011. In a Kafka-esque twist, the most recent victim of regime purges is the man in charge of them: General Kim Won-hong, chief of the secret police and minister of state security, who was sacked last month.

Flame-throwers and machine-guns are said to be Kim’s favoured methods of execution. But the method allegedly used to assassinate his troublesome playboy half-brother, Kim Jong-nam, in Kuala Lumpur on Tuesday recalls a similar incident in South Korea in 2011, when a North Korean agent attacked an anti-regime activist with a poisoned needle concealed in a pen.

Gruesome stories of the fate of relatives and senior advisers who have fallen out of favour, none officially corroborated, are complemented by persistent rumours of Kim’s unstable mental state. Aged about 34, he is reportedly chronically overweight and suffering from diabetes.

But there is another, more confident and competent aspect to Kim’s one-man reign, and it is this more serious side that has western analysts worried. In recent months, Kim has declared North Korea possesses an inter-continental ballistic missile capable of hitting Los Angeles and pledged more nuclear detonations after last year’s two atomic tests.

And he virtually gatecrashed Donald Trump’s cosy Palm Beach golfing weekend with Shinzo Abe, Japan’s prime minister, by firing a new type of ballistic missile over the Sea of Japan. It was a provocation exactly timed to put both men off their swing.

Thae Yong-ho, a senior North Korean defector, said last month Kim was on a “slippery slope”. Speaking in Seoul, he said the regime’s days were numbered. “The traditional structures of the North Korean system are crumbling.”

But Kim’s bumptiousness, including blithe defiance of repeated, unanimous UN security council condemnations and sanctions, does not mean that he is a man on the brink of losing the plot. In fact he may simply be following the example of other world leaders.

Kim will have noted how Vladimir Putin, Russia’s president, has repeatedly defied global opinion without suffering especially dire consequences. Russia’s annexation of Crimea and the war crimes allegedly committed by its forces in Aleppo are recent cases in point.

An instructive example of how to get away with murder is the 2006 poisoning in London of Alexander Litvinenko, a Putin opponent. His death was officially blamed on named Russian agents, but none has been arrested or prosecuted.

China, Kim’s only ally, may be another role model. The death on foreign soil of Kim Jong-nam, a potentially subversive critic, recalls the 2015 abduction to the mainland of five Hong Kong publishers by Chinese state agents. The publishers did not die. But nor was anybody punished. Perhaps Kim thinks he can act with similar impunity.

Trump’s failure to take punitive measures following the weekend missile test may have emboldened Kim. Like the rest of the world, he was waiting to see whether the new US president matches his words, highly critical of Pyongyang during last year’s election campaign, with actions.

Perhaps Kim figured that, in the Trump era, it would be no big deal to bump off a troublesome relative. Trump has rationalised murders that occurred during Putin’s time in office, describing the Russian leader as a “killer” whom he nevertheless respects. This is the sort of mano a mano respect the dysfunctional, isolated Kim craves.