"Oh, the bathroom is actually the next door down." While temporarily effective, you have only bought yourself a few precious seconds to decide your next move. Either you use those seconds to accept your fate, or you move on to one of the following, more drastic, excuses. Also, this only works in public places, it is a SERIOUS long shot if you're at their apartment.
"The pipe burst!" Again, this is a desperate call. You will be able to stop your target for a few seconds, but this will have to include some sort of reason why you didn't do or mention anything about the burst pipe in the first place. For these reasons, see the corresponding list article, "8 reasons why you didn't immediately tell everyone else the pipe burst in the bathroom."
Weave everyone a tale that will enrapture them such that they will forget their need for excretion. I am not going to lie, you are going to have to pull out all the stops. The story will need to start in a big place, no slow burns here. Maybe try a shoot-out scenario- that seems to work well. Then, get some likeable characters in the mix, and quick. From here, weave the tale until you feel confident the smell has dissipated enough.
Classic tactic for not only feces-smell related issues, but for all parts of life. Pick someone in the room, and say they did it. Stand up, and with strong emotion, either comical, hateful, or despairing, point to someone and say, "Robert took a shit in the bathroom and it fucking smells terrible! There are goddamn shit marks ON THE TOILET AND I FLUSHED TWICE!" Be prepared to lose Robert as a friend, for at least the immediate future, if not years.
You have just remembered something and you must tell it get it out. Everything else must immediately be put on hold, including (especially) going to the bathroom. Take any angle you like, any angle at all, but again, it is up to you to sell it. A medical example like, "I didn't want to mention this but I felt a lump..." or a situational example such as, "Oh my god, I forgot to tell you, your Dad called and said you inherited a pub!" can be very effective.
Get weird. Do anything, the crazier the better. Pick up a TV remote and start sticking it in your mouth while you talk about how your favorite toe looks like a pig. Get up in someone's face and bark at em, call em a pickle and say, "woah boy, pickle pickle!" Just make it big and undeniable. Also be prepared to have to explain yourself thoroughly or for a visit to some sort of mental health professional/ facility. Another route here is to admit you have a serious drug problem, which may necessitate actually adopting said drug problem in order to cover your story.
Yes, just tell them. Tell them you went into the bathroom and took a dump so gnarly you are afraid that they will think less of you, as a human, if they were to go in and smell it. Tell them, that if they cared about you or had any empathy, they would sit back down and immediately discuss a completely different topic, push away all awkwardness and further questioning for a small amount of time, at least like 5-10 minutes, so the smell can go away and all can continue on into life, dignity intact.
If you poop in the room, right there in front of them, I personally guarantee they will not be thinking about the poop smell in the bathroom. Personally guarantee.
Here's some more poop: