This is hard for me too, especially when around extended family members. I’m thinking of doing what you said about bringing my own dish (my husband suggests I make a large dish for our family outings, for sharing) and just politely approaching the cook/host and saying, "I really appreciate you having us over. We enjoy spending time with you. I’m following a specific way of eating that doesn’t allow for carbohydrates in my meals, so I’ve prepared X to share. I hope this isn’t rude, I’m just trying to figure out how to follow my diet AND be a part of fun get-togethers like this."
I don’t know, it’s still being refined. But I figure hitting it head on politely is the best I can do.
After I had a post-carb headache, I was advised to Keep Calm and Keto On, drink lots of water, and eat some fat. It helped and the headache will go away eventually!