The very first time I made a starter this happened and it erupted all over the carpet in my Dad's living room. It has happened a number of times since then and I thought it was because I had swirled it too much and the top of the flask got sticky and sealed with the foil. Then I started using a foam stopper that lets air pass through, and the same thing happened again. So it isn't that pressure is building up. I don't know if there is something about specific yeast strains that makes this happen. Or maybe if the yeast is growing particularly quickly, the CO2 can't escape quickly enough and gets absorbed into solution.
I have noticed that if I can make a starter during a time when I plan to be around, swirling it more frequently can mitigate the problem. Basically, that just shakes the CO2 out before there gets to be too much.
Another thing I've noticed is when I give my flask a real good PBW soak prior to using it, I don't have to worry much about boil overs or foaming when it is swirled. But if I've only washed it with dish detergent (and rinsed thoroughly), then the foam tends to grab hold of the sides of the flask more and take longer to dissipate. That means, I have to wait longer in between swirls, which means more CO2 builds up, which means... blah blah blah. You get the picture.
So, make sure your flask or whatever you use is super clean, and then swirl it as frequently as you can while it is fermenting. Also, if you know it has been a while since it was swirled, just be super gentle with it and swirl it a tiny bit at a time to release the CO2.
I have (slowly) been working on making a homemade stir plate from old computer parts. That is probably the easiest solution, because that would keep it moving constantly and the CO2 would definitely not have an opportunity to get absorbed.
Sorry to ramble so long.