My first thought was that boys go shirtless with shorts all the time where I live, no big deal. So wearing swim shorts is kind of the same thing I guess. There is no pressure around it, just an everyday thing for them.
I'm surprised the swimming classes were coed. When I was in school our swimming units were on separate days. They didn't allow the girls to swim with the boys for obvious reasons