I've discovered that Whirlwind won't hit allies, but it will hit neutral parties. So if your party is attacked in a town and the guards are also against those people, you can, say, hit two enemies and a guard with Whirlwind, which makes all of the guards permanently hostile. Ouch!
Friendly fire should be it-hits-everything (like Fireball) or it-only-hits-enemies. None of this "enemies-and-neutrals" counterintuitive weirdness that makes you reload your game.
(Also, Cryogenic Stasis is bypassed by Shackles of Pain damage. I don't know if this is intentional or not, and it could be debated what "should happen". But I didn't expect it to happen as programmed the first time I noticed it, FWIW.)