Shunning is a horrendously stone age way of trying to control and influence others but the law will never make it illegal. You can't force people to talk to others.
I used to think that was a compelling argument. But now I think it misses the point. No law would be drafted to say that shunning another person is illegal. What could conceivably be made illegal is operating an organisation whose policies and documents mandate and regulate shunning. That could technically be made a matter of law, presumably, just as organisations are not allowed to discriminate on the basis of race, gender, sexuality, they would not be allowed to formulate and promote and a system that stigmatises former members. So I don't think it's impossible or a ridiculous idea.
Having said that I don't think it's a good idea to go down the route of banning organisations that employ shunning.
Removing charitable status on the other hand seems entirely proportionate and would be effective in my view.