Boris Johnson’s self-identification as the new Winston Churchill invites widespread scepticism. But, if the member for Uxbridge and South Ruislip forms a government this summer, he will, in one respect, immediately emulate Churchill, and indeed Benjamin Disraeli – as a Conservative prime minister who is also a novelist.

Disraeli had published 14 works of fiction by the time he took the highest office, while Churchill was a one-off novelist – an African adventure yarn, Savrola (1900) – in common with his modern Tory impersonator. Seventy-Two Virgins – A Comedy of Errors came out at the start of September 2004, when Johnson was MP for Henley, shadow arts minister, and simultaneously editor of the Spectator, in contradiction of an apparent undertaking to the then proprietor not to combine the editorship with parliament.

A hostage thriller in which an ambulance plays the role of the wooden horse the Greeks built to fool the Trojans, Seventy-Two Virgins is structurally audacious. Its 336 pages cover just three and a half hours in Westminster, during which a terrorist group of suicide bombers, whom the narrative voice calls “Islamofascists”, targets the visiting US president, as he gives a speech in Westminster Hall.

This assassination-massacre plan is stumbled on by Roger Barlow, a bicycling Tory MP known for tousled hair, classical allusions and flapping shirt-tails. As the story develops, he sees the chance to make himself such a global hero that the media will judge it futile to publish the latest thing he doesn’t want to tell his wife.

That subplot increased in intrigue when, within two months of hardback publication, Johnson was sacked from the shadow cabinet after the Tory leader, Michael Howard, judged him to have lied to the party and public about an extramarital affair. Reread now, it’s striking that Barlow’s view – that public value should make private conduct irrelevant – is one the writer has continued to embrace through domestic troubles up to and including last month’s publication in the Guardian of details of a row between Johnson and his partner, Carrie Symonds.

If Johnson attends a G20 summit, he'll have to hope the French president hasn't been briefed about the role played by the French in the novel

Disraeli’s novel Sybil, or The Two Nations (1845) vividly previewed the politics – “one nation Toryism” – that the writer would pursue in office, and Churchill’s Savrola, though four decades before his first premiership, shows the development of his ideology on conflict. So what might Seventy-Two Virgins tell us about Johnson at the top?

It may be no great surprise that the novel is fundamentally undiplomatic; few readers would seem likely to come to the conclusion that the author would or should subsequently become UK foreign secretary.

If Johnson ever attends a G20 world-leaders’ summit, he will have to hope that the president of France has not been briefed about the perfidious, duplicitous, imperially arrogant role played by the French in Johnson’s novel, which makes his more recent reported description of the nation’s politicians as “turds” look kindly.

Bicycling Tory … Boris Johnson, when he was mayor of London. Photograph: Yui Mok/PA

Most strikingly from an author born in New York, and who has expressed admiration for Donald Trump, the book is relentlessly anti-American, repeatedly describing the UK-US “special relationship” as a farce. This is because Johnson, at the time of writing, was advocating, as a journalist, the prosecution for war crimes in Iraq of Tony Blair and George W Bush, who is clearly the president in the novel, although never named, perhaps because the publishers worried about the tastefulness of depicting a serving leader as a victim of terrorist violence. For reasons unclear, Johnson even twice breaks the flow to have a go at Sierra Leone.

None of the racial rhetoric stoops as revoltingly low as the “piccaninnies” and hijab-wearing “bank-robbers” that Johnson has referred to in journalism – possibly reflecting the greater severity of the book-editing process. But there are comic riffs on the promise to jihadists of a posthumous reward orgy that gives Seventy-Two Virgins its title, plus references to “Islamic headcases” and “Islamic nutcases”. Arabs are casually noted to have “hook noses” and “slanty eyes”; a mixed-race Briton is called “coffee-coloured”; and there are mentions of “pikeys” and people who are “half-caste”. If this prose tone sounds older than 2004, it may be because the book feels to be attempting a stylistic marriage between the upper-class farce of PG Wodehouse (1881-1975) and the anti-liberal social-sexual comedy of Tom Sharpe (1928-2013).

The book's attitude to women is such that if he fails to become PM, Johnson could write the new Carry On films

It is important to acknowledge that novelists do not necessarily share the views of their characters; noxious opinions may be ventriloquised for narrative or satirical purposes. However, Johnson’s fictional style is so undisciplined – moving in and out of viewpoints, into which a boomingly familiar authorial voice often intrudes for several pages – that it is impossible to separate him from all, or even many, of the ideologically provocative comments.

The novel’s attitude to women is so sexist that, if Johnson fails to gain the premiership, he could be a good bet to screen-write the recently announced new string of Carry On movies. I counted 20 occasions on which women enter the narrative. Each time, the narrator or a character looks them up and down, phwoaring over, to take a representative selection, “tits out”, “lustrous eyes”, “long legs”, “a mega-titted six-footer”, “loads of pretty white teeth”, “good teeth and blonde hair”, and an “unambiguously exuberant bosom”. One woman’s comment is attributed to “premenstrual irrationality”. In this context, appearances from a “girly swot” and a woman who looks “like a lingerie model, only cleverer and, if anything, with bigger breasts” count relatively as feminism.

‘Perhaps only Freud could tell us why Johnson named a young woman after whom his alter ego lusts ‘Cameron’ ... Johnson and David Cameron in 2014. Photograph: POOL/Reuters

Fifteen years on, whether or not he knows it, Johnson is rhetorically recycling lines from the novel. A metaphor about searching for a crouton of sense in a minestrone of arguments, which he turned against BBC political editor Laura Kuenssberg during a rare leadership campaign press conference, is in the book. “Vassal state”, his favoured description of the UK’s relationship to the EU under Theresa May’s Brexit deal, applies in the novel to how the US treats Britain.

In its last third, the plotting becomes rushed and the prose sloppy; there are several printing and grammatical errors, and sentences that literally don’t make sense. From what is now known of Johnson as a last-minute improviser – not least by Nazanin Zaghari-Ratcliffe, who remains in jail in Iran partly due to a reckless ad-lib by him as foreign secretary – is it possible that he had missed deadlines, and so had to rush to finish and deliver the manuscript?

That would be revealing; as is much in the book. Because the subconscious is so involved in the percolation of fiction, novelists often disclose more than they know or intend. Perhaps only Sigmund Freud could tell us why Johnson named a young woman after whom his alter ego Barlow lusts, “Cameron”, the Eton and Oxford contemporary who became his bitterest Tory rival.

But most significant, given the office at which the novelist is now tilting, is the suggestion – from both an external observer, and the protagonist’s inner voice – that Barlow may be a fraud. His assistant worries that, under the jaunty vaudeville act, there are no real core ideals, values or beliefs.

“To a man like Roger Barlow,” Johnson tells us, “the whole world just seemed to be a complicated joke … everything was always up for grabs, capable of dispute; and religion, laws, principle, custom – these were nothing but sticks from the wayside to support our faltering steps.”

How many Conservative party members – the electorate Johnson must convince – would share that startling political and spiritual nihilism? Among the many other aspects of the novel that now make it seem inconvenient on the CV of someone seeking to be PM, that passage makes you wonder if Johnson’s campaign team should have found and quietly destroyed all extant copies of Seventy-Two Virgins.