I dunno. On one hand I think any confession to a priest should be confidential. But if someone killed someone and confesses, the dilemma is, if the priest doesn't say anything, the possibility that the person will kill more people. So which is worse? Same for psychiatrists etc. Maybe before confession or anything else, it should be made clear that everything said is confidential UNLESS it involves a serious crime...murder, rape and the like, certainly nothing like drug use, shoplifting etc.
In that way there is still confidentiality except in the above examples, in which case the confessee is aware beforehand that anything involving harm to others is exempt from that confidentiality