When you die, your bowel muscles relax, causing “leakage.” I don’t know if I would consider it really the same as taking a crap. Of coure, if you took a crap right before you kick the bucket, then there won’t be anything there to, eh, leak.
When my dog died from a heart attack, she evacuated a full bowel and full bladder in the minutes between the heart attack occuring and her expiration. I suspect that if humans have a full bowel or bladder at the time when the sphincters which “hold it all in” relax, then the same occurs.
My guess is that the suddenness of death, and how long after the person last ate or drank has more to do with this process than the trauma of death itself.
Although I do believe that body cavities are plugged post-mortem to absorb “leakage” of residual fluids, I don’t think that’s what you’re talking about.