In the city I don't know of a better way of disposing of human waste than in a trash can (sealed in a plastic bag within a plastic bag). In regulated areas people are told to "pick up after the dogs" and dispose of the waste. To the best of my knowledge they throw the bagged waste in the closest trash can (including those at the park). I don't recommend drawing attention to yourself doing it, but I do not think it is illegal.
Remember that human waste may be nasty to us, but it is no more "dirty" than the fecal matter from millions of animals that defecate all over the United States. In Florida where I am from there are hundreds of thousands of pets, dogs, and cats, as well as wild raccoons, squirrels, rabbits, possums, etc. that defecate anywhere they please. In National Parks you probably are not allowed to dispose of human waste in the forest but this has more to do with the QUANTITY of people visiting that could damage the place for others than it does the actual damage caused by one pile of human waste.
In offgrid places on millions of acres of BLM land, where you may not see more than one other human for every 500 acres of land, the amount of human waste you may "bury" will have only a beneficial effect on the environment not a detrimental one. It can actually add nutrients to the soil. I remember we were traveling through one of the states out west 10 years ago and they actually had a sign at the highway roadside rest area that said "dumping of gray water encouraged". Here the land was so dry they actually allowed the big RV's to dump their sink and shower water on the ground. This actually helped the areas animals and plant life. Many offgrid folks use compost toilets and actually make good soil from human waste mixed with the right grasses, dirt and bacteria.
Now I realize that gray water is not the same as black water but the point remains. Human waste in small quantities, properly buried under 4-6 inches of soil or disposed of in a trash can with double plastic bagging does no more damage to the Earth and is no more illegal than the disposal of other trash.
I use public bathrooms when available. If none are convenient I double bag and dispose of in an appropriate trash can. When well out in the wild country where no humans are seen, I simply bury the waste and skip the plastic bags altogether. NOTE: a simple search on Google for "biodegradable bags for disposing of human waste" returned hundreds of products you could use if you need to "poop in the portable toilet" then bury the actual bag. These special bags do not hurt the earth.