There are a few places were zoning allows people to do whatever they like... or even if there are rules, no one inspects. It's not common in any of the places I want to live, though! A hunting cabin may be exempt because it is a temporary dwelling and small.
Cochise County AZ has a reputation as having pretty free codes, but a composting toilet is only allowed via a special permit if water is unavailable for a flush toilet. I'm guessing that isn't difficult to get because many people haul water (no well or city hookup). I see no mention of pit toilets being allowed at all... because you know, herds of animals can poop all over, but a human living alone on 40 acres needs to regard his as toxic waste...
Unless you have a recycling system, gray water (shower, kitchen, etc) requires a septic anyway. It definitely isn't "do whatever you like" but you might be able to get away with anything so long as no one complains.