How to politely reject co-authorship offer from a colleague?
I don’t think the question of how to “politely” decline the coauthorship is really worth fussing about. If you want to decline the coauthorship, that’s absolutely okay, just say so in plain words and explain that you don’t think your contribution was great enough to be a coauthor. I can’t imagine anyone ever being offended by this, as long as you don’t imply that you think the paper is worthless.

With that being said, I do think you are perhaps a bit misguided in where you are perceiving the bar for coauthorship to be compared to where it actually is. Everyone knows that being a coauthor can mean a variety of things, which can range anywhere between “I wrote the whole damn thing myself and my coauthors just answered a couple of questions I sent them over email” and “I just answered a couple of emails”. So, if someone asks about the paper in your viva, just tell the truth and say that your involvement was minimal - that is nothing to be ashamed of, but also doesn’t mean that it’s unreasonable for you to be a coauthor.

To summarize, as I said it’s absolutely fine if you wish to decline, but it’s best if that decision should be fully informed and based on an accurate understanding of what coauthorship is understood to imply.