The ninja would carry a small thin saw shaped around his upper gums. Often, when travelling, people would be stopped at checkpoints or at random and searched or questioned. If you were suspect, you would be stripped completely naked and put into a bamboo holding cell until they decided what to do with you. If they want to search inside your mouth (which they likely would not), then you get angry and hostile so it becomes difficult and they skip it, maybe try to bite them and act rabid. Then, when you are alone, remove the saw blade and cut your way out. Perhaps add saliva to quiet it if necessary.