You can’t clean something without making something else dirty. You can’t get rid of dirt. You just move it to something else.
DIrt is just something in the wrong place. A composting toilet converts the most offensive kind of dirt into beautiful soil for use in food production. You just have to design the right kind of circuit so that dirt itself becomes clean.