Even without chemicals, you should be worried about, well, a lot of stuffs, like anthrax, tetanus, salmonella, or even botulism. If somehow you can avoid those things, parasites are also abundant in soil.
"Good" soil would have a lot of decaying matters and excrements. Yucky stuffs to put into your mouth, unless your biology really adapts for such thing. I know the animal kingdom have a lot of species that don't care for those things, but they are spec-ed for those things, like birds swallowing rocks or rabbit eating its own poops.
I'd rather a lazy method like elves asking earth spirits to check soil quality or something.
Fair enough.
Think you are conflating tasting with ingesting. Taking something into your mouth and spitting it out is a time honored survival tactic to test if something is edible. The same is true in many other fields.
I've known old time mechanics to taste mysterious fluids on the vehicles they worked on and make judgments based on the taste.
I was I taught as a cook to taste questionable ingredients to determine spoilage.
I've even seen in many a movie, novel, and anime where an alchemist or chemist will use taste to identify a substance or material.
And yes even the odd farmer who tested soil quality with the tip of their tongue.
So you'll have to forgive me when I see your comment worrying over microbes, pathogens, and toxins and think you are the silly one for believing they actually swallowed what they just stuck in their mouth or touched with the tip of their tongue.
---edit---
Just as an aside, if you are truely worried about fecal matter entering your mouth, i would advise you to never keep your toothbrush in the bathroom. Not because of the off chance some asshole will clean the toilet with it, but because every time you flush, a geyser of particulates is ejected from the bowl.