In the question, "Would I take friendly fire damage if I had a mage as companion?", we learn that followers can deal friendly fire damage to the player character.
So, how do I prevent followers, conjured/reanimated creatures and other allies from dealing friendly fire damage to the player character, or improve their AI to avoid them hitting the player character?
I'm playing on the PC, so console commands and mod solutions are welcome.
Note: I'm talking about preventing friendly fire damage from allies to the player character, not the other way around. I am already aware of console commands and in-game abilities that will prevent friendly fire damage from the player character to some allies.