Pain - going to depend a lot on the size and shape of your P's penis. The smaller the member, the less it is likely to cause pain...
my slogan would be..."do not let anyone cum in your bum"...it's just not worth risking anal cancer for, we still know so little about hpv transmission (medics seem undecided if it is transmitted from sperm or skin to skin contact) but something like 80% of anal cancer cases have detected hpv-16 in biopsies.
As for piles.. Good measured advice here..
www.hemorrhoidshemroids.com/anal-sex-and-hemroids-hemorrhoids.html
here is an extract...
The system of tissue, muscle, bone and tendon that allow the intestinal system to finish its job are quite complex. The anorectal canal is supported within the body by both muscles and tendons. Blood filled cushions line the bottom end of this canal, allowing the body to move, stretch and bend without damage to the canal itself. These cushions also help with anal sphincter control and signal the body when a bowel movement is necessary.
Anal sphincter muscles are not very strong. They are also easily damaged. The hemorrhoidal blood cushions help protect these muscles and those of the pelvic floor from tearing. These cushions are filled with balloon-like veins. When necessary, the veins swell to make the cushions bigger and capable of absorbing more shock. After the need has passed, the veins usually go back down to normal.
Internal hemorrhoids originate from these cushions when the veins swell so large they can't go back down.
Chronic abdominal strain and chronic anal irritation are the two root causes behind most hemorrhoids, and anal sex gives an ample amount of both.
First, whenever the body senses something within the anorectal canal, it tries to push that object out. It's a reflex and it allows normal feces elimination to work. Much of that "pushing" comes from the abdominal muscles, which forces blood down into the hemorrhoidal cushions.
Second, the normal function of the anal sphincter is to allow a bowel movement, not to be rubbed against for a long period of time. If you rub your hand rapidly back and forth across a rough surface, the tissue will swell due to irritation. Anal sex irritates the anal sphincter and anorectal canal in the exact same way.
Anal sex hemorrhoids and anorectal damage usually happen due to badly performed anal sex. There are no studies that indicate any anal damage at all when the practice is done correctly, but most people who do it don't take the time to learn enough about safety.