This is one of the biggest fear of a bottom and I don't think there is way to prevent it. I try to be as meticulous as I can about pre-sex cleaning but there is no way to prevent gas even when partners penis is thick. When I feel that I am about to pass gas during penetration I squeeze myself so hard to prevent it, sex stops being pleasurable for me.
I had one fuckbuddy that passing gas happened once having sex with, he just smiled at me and went on. It was so soothing and we forgot about it a minute later and keep enjoying hard anal sex for more like 30 minutes.