As mentioned previously, one thing the Sages learned from the verse (Devarim 23:15) “Ve Lo Yirae Becha Ervat Davar” is that one may not say any words of Torah in the presence of one’s own or another naked body. In the same verse it also says “Vehaya Mahanecha Kadosh” (lit. “your camp shall be holy”) and from here it is learned that one may not say any holy thing, such as Keriat Shema, in the vicinity of human waste or any foul substance. Unlike being in the presence of a naked or immodest person, one may not even contemplate Torah thoughts in the vicinity of a foul substance.
One practical application of this is being in the vicinity of a child in diapers. If a bad smell emanates from the child’s diaper then it would not be permitted to pray or learn Torah nearby, and one would need to distance oneself four Amot (roughly 6 ft.) from the outer limit of the bad odor. If the child is in diapers but one does not know whether the child relieved him or herself, then Rabbi Ben Zion Abba Shaul (Or Lezion, vol. II, ch.6, §14) says that as long as one does not smell anything there is a presumption that the child is clean and thus one may pray nearby. Even if the child did relieve him or herself and one cannot smell it, there are opinions that say that since the diaper acts as a covering for the waste then one may be lenient. It should be noted that a child’s waste is considered human waste only once the child eats grain-based food. If the child is still only consuming milk, then his or her waste is not considered human waste even if there is a foul odor, and one would be able to pray nearby. Certainly, if one did smell a young infant’s waste, then even though technically permissible, one may wish to still distance oneself in order to fulfil the words of the aforementioned verse.
Rabbi Ben Zion Abba Shaul (ibid., § 17) also discusses reciting Keriat Shema near a sewage pipe. Since such a pipe is known to be a receptacle for human waste, even if it does not emit a bad smell one would need to recite Shema at least four Amot away. In order to be able to pray close to a sewage pipe or the like, it would need to be covered or buried in cement.
Regarding toilet bowls, even though they may be completely clean, they are also considered receptacles for human waste. As such one may not pray or learn facing a toilet if the bathroom door is open and one would need to either close the door, or at least turn the opposite way. It goes without saying that it is forbidden to do such activities in the bathroom itself.
Summary: One may not pray or learn Torah near human waste or receptacles for human waste, including toilets, sewage pipes or dirty diapers. If one does not smell a foul odor from a child in diapers, one may assume that they are clean.