Wikipedia writes:
Excommunication as it exists in Christian faiths does not exist in Islam. However, under Sharia law, the penalty for apostasy in Islam is death. The nearest approximation is takfir, a declaration that an individual or group is kafir (or kuffar in plural), a non-believer. This does not prevent an individual from taking part in any Islamic rite or ritual, ...
I had thought this statement was accurate (although "takfir" and "excommunication" are quite different), but I just enountered an IslamWeb fatwa, which says:
If a man has sex in the anus with a marriageable woman he deserves a corporal punishment determined by Islamic Law, which is to be slashed 100 times and exiled for one year if he is single, but if he is married he will be stoned to death, because he had forbidden sex.
I'm not sure what to make of this. It might be a mistake, but it seems unlikely (and raises questions about the accuracy of fatawa). The fatwa does not give evidence to support that this is the prescribed sharia punishment.
Question: Is excommunication used a form of punishment in Islam?