Getting rid of stuff that reminds you of your ex makes emotional sense for someone who is going through a breakup and is really upset. Giving it all back to the ex strikes me as something that is designed to hurt the other person - retroactively rejecting any presents or other things they've given over the course of the relationship, and rubbing it in their face.
If it were simply a matter of getting rid of painful memories, throwing stuff out, selling it, or giving it to charity would be better options, with the exception of particular items that had sentimental meaning to the giver (family jewelry, for example), stuff that actually belongs to them but was at your place (like spare clothing, or DVDs), and jointly purchased items of more than trivial value.
Doing the throw-away/give-back for friends strikes me as way over the top. If someone has acrimonious breakups with close friends often enough to have an established routine to go along with it, I'm going to start wondering whether they're the one producing the drama.