Sherlock so thoroughly crystallised in the public imagination the idea of Benedict Cumberbatch as a powerhouse of restraint and understatement that it is a shock to see him cut loose as a heroin-addicted aristocrat in Patrick Melrose (which will arrive on Sky Atlantic on May 13).

But this is the best kind of surprise, as Cumberbatch puts in a magnificently mercurial shift in a five-part adaptation of Edward St Aubyn’s chronicling of childhood trauma and the substance abuse that became its terrible corollary in adulthood.

What’s especially impressive is that Cumberbatch gets under the skin of the out-of-control and often unbearable title character without ever quite over-acting (a less precise performer would surely have leant into the drug memoir pantomime and given us Bertie Wooster-on-opiates).

There is certainly plenty of scenery to be chewed. That’s especially the case in the first episode, as Melrose – indolent heir to a society fortune – gadflies around early Eighties New York, where he has traveled (by Concorde, obviously) to collect the ashes of his loathsome father, David. Smack, quaaludes and Martinis are hoovered in elephant-killing quantities. Melrose engages in shouty conversations with the ghosts pinging around his head. At one point, he scalds himself running a bath to the strains of Cool for Cats by Squeeze.

Yet for all the freewheeling Cumberbatch never loses his grip on Melrose – a bravura tight-rope walk given the obvious temptation to surrender to the hamminess that the role of the debauched posh boy fleeing a childhood ordeal invites. The rest of the cast is fantastic too: Hugo Weaving as his lidded monster of a father, Jennifer Jason Leigh his weak, booze-tranquillised mother, Allison Williams (Girls, Get Out) as an initially sympathetic acquaintance who flinches from Melrose’s self-pity and neediness.

Benedict Cumberbatch stars as Patrick Melrose credit: Sky/Showtime

St Aubyn’s quintet of Melrose novels – which includes 2006’s Booker-nominated Mother’s Milk – are described as loosely autobiographical and it’s the harrowing details that dovetail with the author’s life (each episode of the mini-series is based on one of the books). Both writer and alter-ego Melrose were horrifically abused by a cruel, domineering father, and sought to numb the pain as young men with booze and heroin. Mostly heroin, if the adaptation is any guide.

The temptation to sweeten the pill for television is wisely resisted by director Edward Berger (Deutschland 83) and novelist-turned-screenwriter David Nicholls, whose harrowing script belies a CV dominated by froth such as Cold Feet and Bridget Jones’s Baby.

Those of squeamish disposition may, in particular, find the many scenes in which Melrose pumps his veins with dope almost unwatchable. Meanwhile flashbacks to his upbringing in the South of France – where Strike’s Holliday Grainger pops up as a jaded hippy – lays out the facts of David Melrose’s depravity, matter-of-factly and horrifically.

Allison Williams, Benedict Cumberbatch and Jennifer Jason Leigh at the Patrick Melrose premiere in Los Angeles credit: Jon Kopaloff/FilmMagic

On the page St Aubyn keeps the gloom at bay with acerbic prose that sparkles. Cumberbatch achieves similar results by imbuing Melrose with a damaged swagger. Most of the time you don’t even notice he’s a good decade-and-a-half too old to play a 20-nothing drug addict. Tellingly, when he is absent from screen, as he is for extended passages of the second episode, the series loses a great deal of its nervy punch.

In a surreal juxtaposition, Cumberbatch attended the Patrick Melrose premiere the United States the same week as his much higher profile return as Doctor Strange in the latest Marvel film, Avengers: Infinity War. But the really super-heroic performance is here, as he inhabits a disturbed and desperate individual and elevates the character’s struggles beyond mere misery porn.

Patrick Melrose begins on 13 May on Sky Atlantic. Or watch with a two week free trial of the NOW TV Entertainment Pass