I'd say, "When you gotta go, you gotta go... mind your business!" Now, I've peed in my yard - when I had one - and my neighbor saw me and all I said was, "I wasn't gonna make it..." and since they were a guy, he just nodded his understanding.
OK for the environment? Sure. Potential for having to register as a sex offender if observed, reported, investigated, prosecuted, and adjudicated? Remote, but yes, also that too. As a general rule, in most places, if a passerby on the public street or the public-use easement on your property commonly referred to as a "sidewalk" ("footpath" for speakers of British English) can see you with your genitals exposed, it's problematic. If you can be seen from a neighboring backyard, it's generally problematic, unless you have a fence and the only way a neighbor could see you with your genitals exposed is if said neighbor stood on something to peer over your fence. It is extremely rare for a woman to be charged with a sex crime, such as felony indecent exposure, for urination outdoors, because the usual posture of squatting renders her external genitalia not visible. It is still rare, but more common, for men to be charged thus, because a complaining observer or police officer could describe in some detail what he or she saw hanging between the legs of the urinator. Ultimately, go ahead and pee in your backyard if you are moved to do so, but face a tree or some shrubs that shield your genitals from the view of others, or simply wear a skirt/towel/robe and squat to pee.