In Twain's time, there was a literary subgenre of "squibs," which were essentially trashy short stories published in magazines marketed toward men -- or as they were called in the 1890s, "magazines." Twain wrote a few of these, but the most (in)famous is a little story published in 1876 called "1601." Due to its salacious content, Twain didn't actually admit to writing it until 1906, just four years before he died. It's so filthy that it wasn't legal to print until the overturning of obscenity laws in the 1960s. The story is framed as a conversation between 17th-century England's heavy hitters, including Francis Bacon, William Shakespeare, and the queen. It's written in faux-Elizabethan argot, and the joke is that these fancy-pants tightasses talk about who can rip the nastiest fart or who has the best pubic hair. At one point, Shakespeare tells a story about a dude with four balls.
Now, there's some contention as to whether Twain wrote this tawdry little tale for money or just as an exercise. I keep asking my Ouija board, but all it does is start screaming and demand that I avenge the ghost in my apartment, so we'll probably never know. But it's probably fair to say that Twain wouldn't turn his nose up at a payday, especially if it meant he could get paid to talk about supernumerary testicles -- a subject he was rarely able to explore in his other work.