Is there such a ritual, and how does its process work?
The best source to explore the legend of the pierced porphyry chair is Alain Boreau’s The Myth of Pope Joan (1988; trans. 2001). The first thing to grasp is that there is no historical evidence for a female "Pope Joan," though it's a mighty entertaining story that some medieval commentators accepted. The second thing is that there are indeed two chairs that were once used in the coronation of the pope. Though called “porphyry” they are actually a variety of red marble. One is now in the Louvre, the other still in the Vatican. This pic of the one in the Louvre is useful since it shows a chair with a circular hole in the seat, what we moderns would instantly see as some sort of commode. One theory is that these chairs were imperial birthing stools, used to signify that “Mother Church” (mater ecclesiae) was giving birth to a new son to rule over the church. Boreau rejects this and develops one that is more solidly grounded in an understanding of papal ritual and the historical context during which the chairs drew attention. He see them as equivalents of the ancient Roman “curule” seat, the X-shaped chair that those who help imperium, or the power to rule, were exclusively allowed to use. He argues that contemporaries saw these chairs, first mentioned in 1099, as roughly similar in shape to the curule seat and certainly symbolic of them. In this way, that the pope sat in them at his coronation symbolized the transfer to him of imperium. This was in the era when the papacy was breaking free of secular imperial control and developing the claim of its independence of and superiority to imperial authority so the chairs carried significant symbolic value. Later, one of them was known as the “stercory” or dung chair since the pope sat in it and then rose to symbolize him rising from the lowly position of dirt to a position of power. Later, the satiric, carnival spirit of ordinary Romans seeing or hearing about these chairs grafted on to them the idea that they were used to insure that the pope was male.
Boreau’s book is not aimed especially at a popular audience so he may tell you more than you want to know (I’m summarizing and simplifying about 50 pages here).
I'm just curious if there is a ritual in which some monks are checking if the Pope has male genitalia. I mean he is the future pope one would have go about that process with extrem tact. Would be interesting if there really is a process like this.
Wikipedia says that these sources claim there is one.
Rustici, Craig M. (2006). The Afterlife of Pope Joan: Deploying the Popess Legend in Early Modern England. University of Michigan Press. pp. 1–2. ISBN 9780472115440.
Noble, Thomas F. X. (April 2013). "Why Pope Joan?". Catholic Historical Review. 99 (2): 220
But I realy can't check for myself, as I'm not quite willing yet to buy these books.
Maybe an email to the Vatican could work?