Hi, J..
While my 3-year old daughter has never pooped in her bathing suit, she does almost *always* have to get out of the pool to poop after about 10 or 15 minutes of swimming, whether at her swim lesson or in our pool at home. And even if she went potty (usually just pee) before getting in the water, she still ends up pooping after being in the water for a bit.
I don't have any really good suggestions, but I would not punish her. Maybe try just getting her out of the pool after 10 minutes or so and asking her if she has to go, or even just taking her to the bathroom? Maybe if she knows that it's okay to miss a few minutes of her lesson, or that she can get back in and swim more after she poops on the potty, she'll feel more comfortable and learn to control it better. At least enough to tell you when she feels it coming on. It might be a pain (with the we suit and all), but it doesn't seem like rewards or punishments are the way to go here!
Good luck,
A.