Japan has a venerable tradition of quirky and inventive means of escape from the oppression of summer, as well as from rigid social constraints and conventions. Some of them take distinctly weird forms. In Edogawa Ranpo’s classic story, “The Stalker in the Attic” (1925), for example, the eccentric protagonist — as if a mosquito of tedium is buzzing inside his head — escapes from the boredom and constriction of his daily routine not by fleeing into wide, open spaces but by climbing into an even more constricted space, the closet of his apartment, and choosing to sleep there.

From that self-imposed constraint, he happens to discover a gateway into an entirely unsuspected “other world,” the attic that spreads horizontally above all the apartments in his building. He draws himself up inside it and into a world of surveillance of the private lives of his fellow residents, eventually dreaming up means of cunningly bumping them off.

Within the format of a murder thriller, Ranpo was inventively making the point that an entirely new world of seeing things is available to the protagonist (and us) if only we knew how to tap into it.

In a country where there is a strong demand for social conformity counterbalanced against little means of escape, what happens when the body wilts and the brain addles during the summer heat? Summer is the season when odd things happen and serious business is sidelined. Ordinary eating and drinking patterns are performed inversely from hot to cold as the body embarks on a constant quest for cool drinks (ice coffee), cold food (chilled noodles) and, most urgently, cool air: The mind, too, starts to be turned upside down.

There are other worlds to escape to when the summer heat and irrepressible insects become too much to bear — Irish author Lafcadio Hearn (1850-1904), in a Kafkaesque switch, escaped into contemplation of the buzzing world of the insects.

Hearn, perhaps the greatest of all Western Japanologists and a man of tremendous imagination, was a great world traveler from Britain to the United States to the Caribbean and on to Japan, but he never lost sight of the fact that, without going anywhere, there was, flying and crawling all around him, an extraordinary world of gothic cruelty and mind-bending otherness.

Fathoming the consciousness of insects whose life spans were but a few days, he tuned his ears closely to the sounds they emitted and his eyes to the battles they waged on one another. He observed the horrendous means by which they ate each other. This was another world to which most observers were blind but whose reality was more spectacularly strange than any sci-fi film.

On summer nights in Japan — when many give no more thought to insects than how to keep the ghastly, super-sized Japanese cockroaches at bay — take a moment to contemplate their world.

Hearn observed the Japanese appreciation of the sonorousness and beauty of insects — in contrast to the standard Western revulsion of them — as a hallmark of the sophistication of Japanese culture. But he perhaps didn’t quite connect it to the Japanese tradition of escape into other worlds, of entering into a different mindset, without actually going anywhere.

But then perhaps you should not discount the potential of sci-fi itself to transport you to other worlds. Author Yukio Mishima (1925-70), most famous for his ultimate obsession with Japanese traditions, also had a strong interest in sci-fi and was a fan of Godzilla. There was a period in the early 1960s when Mishima was said to have passed summer nights stood on the balcony of his home combing the night sky looking out for signs of unidentified flying objects.

Indeed in 1962 he even penned his own sci-fi novel, “Beautiful Star,” in which he imagined inhabitants on Earth who declare themselves to be beings from other planets. For Mishima, a man who never felt entirely comfortable within his own skin, UFO sightings were just one form of escape into another world where he might recover his true self and make some sense of the everyday Japanese world around him. Strange? Perhaps no stranger than failing to note the artificiality of many of our daily routines and historical traditions, or the mysteriousness of our life to start off with.

Britons refer to late summer as the “silly season” (in much of Europe, it is called “cucumber season”) when politicians go on vacation, parliament is suspended, people turn their thoughts to ice cream, romances and beaches, and newspapers have to fabricate stories. In silliness, however, you can sometimes find a conduit to your true self more than you will ever do in grave seriousness and traditional ways of doing things.

In Japan, the summer is the period to embrace the unusual and the supernatural and transcend the everyday. Mid-August is the time of the year, o-Bon, when people head back to their hometowns to pay respect to the dead, and in the tōrō nagashi ceremony release lanterns along various rivers to send recently deceased souls to the afterlife.

Summer in Japan is fireworks and festivals, yukata and clattering geta clogs. There was once a time — before the advent of air conditioning — when the intense, insufferable heat was also synonymous with people going out of their minds.

Catch a film like Akira Kurosawa’s “Stray Dog” (1949) in a which a gun is stolen from a police officer’s pocket on a crowded train and soon starts being used in various crimes. There is a strong sense that the gun’s transformation from moral to immoral use will last just as long as the summer heat wave. Watching the scenes of police officers holding a mass meeting as they smoke and furiously fan themselves is to remind oneself of a truly brutal, unconditioned summer world that has thankfully disappeared for most of us.

Yet the frenzy of the film is not just that of the criminals, but represented by the bloodhound-like, obsessive police officer (played with trademark brilliance by Toshiro Mifune) on their trail.

In Japan, the kind of pleasant summer beachtime memories associated with the European summer are often transformed into something far more deadly and seething with menace. In Mishima’s classic short story “Death in Midsummer” (1953), a mother is haunted by the sea when her two children are cruelly swept to their deaths by waves. Mishima himself would pass his final summer of 1970 on the beach, plotting his spectacular suicide that autumn.

In Natsume Soseki’s classic novel “Kokoro” (1914), the vice-like psychological labyrinth leading inexorably to death begins when the young narrator sees the body of the man he will call “Sensei” emerging out of the waves and drying himself off on the beach in the summer heat. Idleness, lethargy and desire fuse in summer and take the brain in a different direction.

A Japanese friend once remarked to me that a Tolstoy story that opened with the line “Autumn had come” as a gloomy harbinger of the approaching blackness of winter had a completely different nuance for Japanese, where it was read instead as an uplifting liberation from the oppression of summer, that period of frenzied minds, wandering ghosts and desperate attempts at escape.

These late summer evenings in Japan are the perfect opportunity for fantasies and holidays of the mind, regardless of whether your physical self is still required to fight through the crowds and sweat and find its way to a pedestrian office desk.