Everyone's had a traumatic not-at-home toilet situation; not having a home field advantage when things get dire can really scar a person. While MacGyvering one's way out of a toilet emergency is not ideal, occasionally it's the only way to avoid certain traumatic disaster.
First—and this should go without saying, but occasionally people get drunk and forget—always, always, always check for toilet paper before you've de-pantsed. Once you've done your business, it's too late to find toilet paper. Your level of anxiety will skyrocket, as it's very disconcerting, being naked from the waist down in semi-public and needing something out of reach. While there's nothing like toilet paper for doing the job of toilet paper, other things will suffice in a pinch: any piece of paper will do, really. Check for toilet seat covers. Feel around in your pockets or purse for sacrificial receipts. If there are posters on the wall of the stall, rip them down and use those (bonus if the poster is for something you dislike, because fuck that stupid party bus service that goes through your city's brobars). If you have a sanitary pad, use that. In a bar or restaurant, you can avoid this uncertainty altogether by grabbing a few napkins before hitting the head.
Once you've ventured out of your house and find that you need to relieve yourself, you run the risk of causing a toilet clog, which is embarrassing. Obviously don't throw tampons or sanitary products in the toilet if you're not sure the plumbing system can handle it, but also make sure that if you must throw it in the bathroom garbage that you assure it's well submerged in the trash, especially if your host has a dog because if there's anything dogs love besides everything they can put their mouths on, it's dirty lady products. Additionally, if you're in a foreign country, make sure you're familiar with toilet paper disposal norms. Many countries have plumbing systems that were installed by the Mesopotamians and that thus cannot handle the modern cushy softness and American insistence of Charmin (or, if you're in some European countries, the sandpapery goodness of whatever brand all the paper towel-like toilet paper is). I learned this the hard way after hopelessly clogging the toilet in my shared apartment in Athens, Greece, much to the anger/chagrin/amusement of my roommates. All because I tried to flush toilet paper down the toilet.
I have a general Don't Shit In Public Or At Houses Where You Are A Guest rule and, in fact, it took me several months of dating my current boyfriend before I felt comfortable expressing myself via my lower intestine when at his house. Devotees may remember that one of the editors had a similar problem and we're surely not the only ones. Poop is gross and smelly and leaves a telltale cloud of stench trailing after you after you leave a bathroom, but sometimes pooping away from home is unavoidable. If your exit from a single-stall WC carries with it a waft of unfreshness, you can try to pretend that the bathroom already smelled when you got in there, but everyone knows that's code for "I have shat mightily." Thus, if you must go number two at someone's house or in a bar or restaurant and there's no getting around the fact that there will be people in line behind you, matches are your best weapon. Good rule to remember, for future reference: if you know you're going to poo, bring matches to the loo.