In 2004, when he was MP for Henley and the prospect of becoming prime minister seemed the stuff of fiction, Boris Johnson wrote a comic political thriller called Seventy-Two Virgins: A Comedy of Errors. It received mixed reviews, sold a healthy 46,000 copies and then slipped into obscurity.

Fifteen years later, as Mr Johnson moves into Downing Street, it is time to re-examine this curious novel, for it contains clues to the prime minister’s views on a range of subjects: Islam, America, terrorism and women. There are many women. They are, invariably, buxom.

Writing novels is a Johnsonian family tradition (Mr Johnson’s father and sister have both written fiction); previous novelist-prime ministers include Disraeli and Churchill; recent politicians who have written novels include Iain Duncan Smith, Ann Widdecombe, Nadine Dorries and Vince Cable.

There are many women. They are, invariably, buxom.

But no politician has ever written a novel containing quite so many hostages to fortune as Seventy-Two Virgins: it is the literary equivalent of stranding yourself on a zip wire while waving two small flags. It may tell us what Mr Johnson was thinking about when he wrote it, but more than that it raises the question: what was he thinking of?

The novel tells the story of a terrorist plot to assassinate the US president during a state visit to Britain. The hero, Roger Barlow, is a tousle-haired, adulterous, bumbling, charismatic, classically educated, bicycle-riding Tory MP. “He’s not me, by the way,” Johnson told this newspaper back in 2004. “But you’ve got to use what you know, haven’t you?”

Right ho, Boris. Or, perhaps more aptly, What ho, Boris; for the ventriloquised voice of PG Wodehouse runs through every one of its 326 pages.

The women in the novel are described in ways that are not obviously prime ministerial: “a mega-titted six-footer”, “lustrous eyes”, “long legs”, “tits out”, “good teeth and blonde hair”, and an “unambiguously exuberant bosom”. One woman is “like a lingerie model only cleverer, and, if anything, with bigger breasts”.

Barlow’s “beautiful research assistant” is called Cameron. Make of that what you will. Here are Cameron’s thoughts on men, which offer some insight into why Mr Johnson is attractive to certain women or, perhaps, why he thinks he is attractive to women: “Cameron had a deep and sexist reverence for men who really knew stuff. It amazed her sometimes how little appearances mattered. He could be bald, he could be spindly or sweaty or tubby, but if the man’s disquisition had enough interest, fluency and authority, it would speak directly to her groin.”

Ladies, be aware: when the new prime minister does that authoritative, fluent classical-allusion-Latin-quotey thing, he may not be speaking directly to your head.

Reviewing the book, Douglas Hurd noted that “the main caricature is clearly of the author himself”. As in all Boris Johnson productions, self-mockery and self-regard entwine.

“He could be bald, he could be spindly or sweaty or tubby, but if the man’s disquisition had enough interest, fluency and authority, it would speak directly to her groin.”

Politicians’ novels are usually written to make a political point, which is why most of them are so execrable. Disraeli’s novels were vehicles for acute social commentary. Churchill’s first and only novel, Savrola: A Tale of the Revolution in Laurania, was about himself, with a protagonist described as the sort of man who could discover “rest only in action, contentment only in danger, and in confusion find their only peace”. Churchill regretted writing it. “I have consistently urged my friends to refrain from reading it,” he later wrote.

Mr Johnson, however, seems to have written Seventy-Two Virgins for a lark, to show that he could, and to mock the strait-laced. The closest it comes to political profundity is when he briefly peers inside the mind of the terrorist, and even then the nudging, Carry On tone never falters. “He found himself staring irresistibly at Cameron in her low-cut top. He felt the surge of fundamentalist rage that inspires the Islamofascistic male … He stared with that perverted Wahhabi mixture of lust, terror and disgust at this portrait of a sexually emancipated western woman”.

But there is also some self-knowledge here, even insecurity, in the portrait of the apparently bungling, deeply ambitious, acutely clever, ethically vacillating English MP: “He worked prodigiously hard. He got things done,” but Cameron still cannot find the “knuckle of principle in the opaque minestrone of his views”. He just doesn’t seem to believe in anything. “To a man like Roger Barlow,” Johnson writes, “the whole world just seemed to be a complicated joke … everything was always up for grabs.”

Seventy-Two Virgins was knocked off during a holiday, and sometimes reads like it. One line, in which an attractive female bottom is described as “a sight to make a bishop kick a hole in a stained-glass window”, is lifted from Raymond Chandler’s Farewell My Lovely.

“The whole world just seemed to be a complicated joke.”

The book contains stereotypes that have got Mr Johnson into trouble in the past: “Islamic nutcases”, Arabs described as having “hook noses” and “slanty eyes”; a “coffee-coloured” mixed-race Briton, and “pikeys”.

The climax comes with the president chained to a suicide bomber on live television, and ends with Barlow knocking out the terrorist with a statuette, using a scything technique “first learned as a child when thwacking the tops of thistles in the meadow”. It all comes good in the end, as the world of Boris Johnson invariably does.

Seventy-Two Virgins is good fun, profoundly unserious, extremely risky and, like the bosoms on which it lavishes such attention, “unambiguously exuberant”.

These are all fine qualities in a comic novelist. In a prime minister, they are unprecedented.