As Halloween draws nigh, online media outlets publish their annual round-ups of the worst costumes commercially available. Such listicles are pure clickbait, allowing readers to enjoy racist, sexist and homophobic imagery while outwardly condemning it. And while “offensive costume” listicles are usually framed as advice on what revellers should avoid wearing, there is no evidence that they actually teach awful people not to use dress-up occasions to be gleefully disrespectful.

Back in 2009 I sketched a taxonomy of offensive Halloween costumes, and most of the outfits that celebrate male supremacy or make fun of minorities remain the same every year. But then there are more timely burlesques of shocking news stories and controversial celebrities. And this year, alongside Sexy Donald Trump and Kim Kardashian’s Paris Hotel Robbery, costume stores have reported a run on gorilla suits as meme-savvy internet jokesters prepare to dress up as Harambe, the gorilla who died at Cincinnati Zoo in May.

Harambe, it needs to be said, is a terrible meme. The joke is based on a combination of anthropomorphic bathos and the satisfying syllables of a Swahili word on English-speaking tongues. And in the racially fraught atmosphere of Black Lives Matter, Harambe’s shooting can’t be separated from the long history of comparing people of colour to apes — which AFL fans are only too happy to continue.

But the strangeness of this media moment — its resistance to coherence and closure, its imperviousness to take after sizzling take — has made a revenant of Harambe. And our continued obsession with consuming his name and image turns us into ghouls — demons who feast on the dead. This makes Harambe a perversely ideal emblem of Halloween, which is a profane carnival when the boundaries between the living and the dead blur, norms of taste are suspended and people embrace their primal, animal selves.

Halloween costumes have their origins in the Celtic harvest festival of Samhain, when ghosts and fairies — both good and evil — were said to roam the earth. Disguising yourself as one of them was a way to protect yourself; but the practice of leaving out food and drink to placate the spirits may have led to the tradition of guising, in which people in costume went door-to-door, receiving the offerings on the spirits’ behalf, and playing pranks on householders.

When pagan festivals were Christianised in early mediaeval times, costumed revelry became carnivalesque. Incorporated into the liturgical calendar, All Hallows Eve provided an opportunity for people from all social groups to mingle freely, to behave eccentrically, to mock authority and to disobey social and moral rules without punishment. As part of this pageant of transgression, people could dress as animals and grotesque creatures, cross-dress and flaunt their sexuality.

In the West, gorillas were originally regarded with the same horrified fascination as Halloween ghosts or monsters. Having long relegated reports of Africa’s “savage hairy race” to legend, Europeans had encountered the creatures for the first time during the 19th-century missionary push into Africa’s uncharted interior. The gorilla was only officially named in 1847, and most Europeans didn’t know exactly how gorillas looked until the mid-1860s, when the entrepreneurial hunter Paul Du Chaillu began selling specimens to museums. In 1865, a taxidermy gorilla family caused an absolute sensation in Melbourne.

Elusive, intelligent creatures dwelling in mist, capable of both brutality and tenderness, gorillas occupied an uncanny, liminal space in our cultural imagination, and became a focus for fierce debates between evolutionists and creationists. Western culture remains fascinated by the gorilla’s simultaneous closeness to humanity and exotic remoteness from it. Koko, a gorilla who knows American sign language and has cared for a succession of pet kittens, has captivated the West since the 1980s. And the 1988 BBC television series First Born starred Charles Dance as a geneticist who creates a human-gorilla hybrid and raises him as his own son.

This same ambiguous humanity has meant that within racist discourse, gorillas have been cast as scary, subhuman monsters — symbols of savage inferiority that even a 13-year-old can deploy. Gorillas began to feature in exotic, uncomfortably eugenic adventure tales from Tarzan to King Kong — including the notorious 1930 exploitation film Ingagi, which contains implied sex scenes between gorillas and white actresses in blackface. Such a context should make this Halloween’s “sexy Harambe” costumes all the more disquieting.

But from the first, dressing up as a gorilla has been to occupy a space of play and trickery. “Mr Columbus Coriander’s Gorilla“, an 1869 short story by Noah Brooks, follows a young man who agrees to impersonate a gorilla in a menagerie, wearing a gorilla skin, in order to woo the owner’s daughter. In Blonde Venus (1932), Marlene Dietrich plays a burlesque performer who strips from a gorilla suit to a sparkly dress — a scene whose uncomfortable racial politics were recently subverted in the TV series Empire. Amid the carnivalesque chaos of the comedy Trading Places (1983), a villainous character is disguised in a gorilla costume and placed in a cage with a real — and amorous — gorilla. (“Sometimes they look so human it gives you the creeps,” observes an oblivious freight guard.)

Gorilla suits also act as cultural camouflage. In Daniel Simons and Christopher Chabris’ famous psychology experiment, participants are so focused on a counting task they fail to notice someone in a gorilla costume strolling right through the experiment. And feminist art activists the Guerrilla Girls don gorilla masks to play pranks on art museums, critiquing the way the art world exoticises and objectifies women.

Could you pick Harambe from a photo gallery of gorillas? Probably not. In life, he was ordinary. But in death, Harambe has transcended his banal mortal form to become a ghostly media meme — a presence haunting our culture. What if, by dressing up as this unfortunate ape at Halloween, we acknowledge that internet culture is a jungle whose foetid depths are still being explored? After all, the media narratives of “offensive Halloween costumes” treat us all like Harambe: as dumb animals punished for acting on our instincts.