(Another blog post I began but didn't quite know how to conclude . . . so it's basically just some idle ruminations.)
In ST:FC, the Borg alter the environment on assimilated decks to a temperature of 39.1 Celsius, 92% humidity, and the pressure is raised two kilopascals (which, for you hurricane watchers out there, would mean it went from 1013hPa to about 1033hPa).
I never really did the conversion before . . . I knew it was hot and muggy, but damn. 39.1 Celsius is 102 Fahrenheit. And that's 92% humidity.
I've been in low-humidity, above-100-degree places on still days. You bake, but it's not really that bad out of the sun. And I've been in high-humidity, above-90-degree places on still days. You boil alive because sweat no longer serves its function, though it sure keeps trying.
In other words, a Borg ship is a hot and humid hellhole. Little wonder they don't worry about folks beaming aboard and milling about . . . what are they gonna do, take over the ship? They couldn't walk twenty paces without stopping for a Gatorade. I wouldn't go in there without a spacesuit, or at least a dehumidifying mask of some sort and a wall-mount air conditioner strapped to my back.
Besides, in those conditions the whole ship would just feel icky.
Of course, we never saw folks aboard Borg ships sweating to death in TNG. By the same token, though, they were never aboard for long. Little wonder ... I wouldn't want to be either. People were aboard for longer in Voyager, but I think they had 'em sweating most of the time.
(Kinda puts a new spin on "Regeneration"[ENT2] and the Borg waking up in Antarctica. No wonder they got the hell off the planet so fast. "Midair shrinkage is futile ... but sh-sh-sh-sh-shit we gotta go!!")
This got me thinking about other races. For instance, "Emissary"[DSN1] gives us mention of the environmental controls in Ops being stuck at 32 degrees Celsius. That's 90, and although Sisko mentioned it was unusually warm he didn't say anything about the humidity. There's never been any solid evidence for the default humidity of Cardassia or Cardassian ships as far as I know, and we can't be sure what the Starfleet standard levels are either.
Indeed, there's no telling what that might be. The US Environmental Protection Agency recommends 30-50% humidity in homes for various reasons, not all of which would apply to a starship. I'd wager that a Vulcan would generally find Earth conditions cold and damp, whereas Ferengi would probably find Earth rather dry. And of course you get outliers like Tholians.
The point is, although we've seen extremely rapid air exchange in places like the bridge ("Evolution"[TNG3], et al., where the bridge is cleared of smoke almost instantly), it seems that the rest of the ship can't have its environment rapidly altered for some reason. Of course some of that has been so-called "dramatic necessity" (i.e. weak writing).
Still, I don't think we've ever seen anyone really fiddle with life support to contain boarders, with the exception of the Romulan drone being made to irradiate a room in "United"[ENT4]. And of course I'm not counting the obvious knock-out gas from "Space Seed" et al. Indeed, most of the time when we've seen boarders they haven't been prepared for any such occurrence . . . I'm thinking here of the Remans beaming to the lower decks in Nemesis in just their uniforms and evidently expecting to make it to the bridge.
Of course spacesuits, even high-tech ones, would undoubtedly slow one down. Even a simple life support belt a la TAS would work, and is doable with modern effects. But I guess by the time folks figured this out it was too late.
(I have to say, though, that the best example of environmental security was from Stargate SG-1 . . . a Goa'uld brig didn't really have a forcefield at the door, as I recall, nor did it need one . . . when the switch was thrown, the floor became a wall, and the brig entrance became the ceiling. That modification to artificial gravity was an ingenious security device.)