I often see this advice about "Friends bad!", and perhaps I've simply never lost enough dwarves in a single incident (aside from the mass starvations of 1051) to cause this sort of problem.
But I have to ask: What about forcing them to hold a wake when you lose people and need to safeguard against this problem?
You can't force dwarves to hold a wake (no way to schedule a party manually, AFAIK, but "organize party" might be an interesting choice to add to the job queue manager...), but you could use a burrow and/or schedules to force everyone into the dining room/mealstorage/bedrooms ((Or better: The previous set and an adjacent jail, all as part of a meeting zone and burrow). That lets you put all your dwarves in one space for faster criminal capture (less "was punched in the head" unhappy thoughts, fewer fatalities from criminal punchings) forces your dwarves to spend time talking to many friends of various levels in rapid succession (more positive thoughts), pushes dwarves into contact with tantrum-arrested prisoners (hopefully offsetting the "did time" thought), gives you a space to put tantrumers who break the law (avoiding "brain punched through skull") where they'll (hopefully) be exposed to friends and loved ones (for happy thoughts).
I mean, if the only jobs a dwarf can take are "admire awesome engraving/table/statue", "talk to people you like", "eat masterful party food", "drink masterful party booze", "sleep in awesome masterful bedroom" and "give water" - aren't you (generally) forcing them to make happy thoughts immediately? I recognize that allowing dwarves to make friends clearly increases the risk of tantrum from other dwarves, especially if it's one of your founding 7 or a pillar of the community, but couldn't it be used to offset this effect as well?
I mean, there's a large number of happy thoughts that could be generated in a short time with the right dining room setup. Zoo thought, masterful item thoughts, good food/booze thoughts, socialization thoughts.. Some of these probably offset (person who talks with enemy, hates the critters in the zoo, isn't hungry/thirsty, etc.) but if there are enough, it would seem you could offset a significant portion of a funeral loss - especially if the person is properly buried.