The tortoise probably has something called a prolapsed cloacea.
It needs to go to a veterinarian immediately. This is not only very
painful, but it's also fatal if not properly taken care of. This
can be caused by straining while having a bowel movement, laying
eggs, a parasite or a tumor. Whatever the case is, it needs to be
taken care of immediately, and preferably with a herpetologist
veterinarian