In one sense, it means that you are ineligible to receive the sacraments, and if you do receive them, they are invalid. This would be the case for someone with un-confessed sins, including heresy, or using birth control for that matter.
In another sense, it is the formal finding of excommunication by the church authorities. That's where a person is supposed to be banished from society.
I don't think that Galileo was ever excommunicated. Feyerabend claimed that the church fathers chose a wording in their finding that stopped one step short of accusing Galileo of heresy (for which they would have had to torture and murder him).
The first type of excommunication you're talking about is the automatic kind. If you commit grave (not venial) sins and haven't been to confession yet, you cannot receive Communion without committing a sacrilege. No formal decree from the bishop is necessary for this. In fact, no one even needs to know you committed a sin, for you to be in this state.
A formal excommunication is a public announcement intended to shame a sinner into amending his life and re-entering a state of grace by repentance and confession. I believe in some cases it requires a public act by the sinner, to let the community know that the public charge of excommunication has been answered. So, to contradict your position, a public excommunication is not a shunning but rather is meant to bring the sinner back into the community.
It might be a useful practice for the Church to do more of...