I don't belive there's a way you *can* turn off friendly fire, at least without SKSe. And even then it's debatable.
All damage hits enemies, noncombatants, and companions equally. There's nothing in-game (aside from IsCompanion) that designates one NPC differently than another in terms of Friendly Fire.
A mod using SKSE *might* be able to null any damage to Companions, using the IsCompanion variable, but I'm not sure if the game is coded to allow that.