This is my case as well (i.e., not a stutterer, but introvert prone to social anxiety). When I was a toddler, my family took a vacation to Mexico, and on the way back into the US, a very stern border patrol officer (who I realize now was just doing his job), started barking questions at me one after another. I immediately froze, and refused to speak. He pulled us over to the side, and it became a tense situation with my parents freaking out, and everyone pressuring me to speak. Fortunately, my sister is a chatterbox and resembles me enough that he let us go (plus, I had my passport), but the experience left a strong impact on me. After that, I felt like I relived the moment in school, every time the teacher called on me to answer.
Later on, I became a bookworm in part because through reading I found that I could pick out words and phrases to reuse in normal conversation.