"Scared", if this were just happening during half term at the holiday activity, I'd ask if he were enjoying it at all or was he overwhelmed by the change and unfamiliarity. At least it would be temporary.
Too shy to ask to go, during term time, that must be awkward and unhealthy, either getting caught short or hanging on with a full bladder. Or worse, not drinking enough, hoping not to need to go.
He will feel very self conscious and miserable I imagine. Lots of children get anxious about interrupting a class to ask permission to go. Others just get too involved and distracted to think about it until oops too late.
Have you spoken to his teacher? Can she have a discreet word with DS?
Are there problems at the school in the toilets/washroom area, is he worried about getting picked on by other or bigger kids at break time or lunch time?
Mum and Dad go to the loo, teacher goes to the loo, the other children have to go sometimes. He just has to put his hand up, ask teacher, walk out, go pee, wash his hands, go back to class.
If there are, say, 28 children in his class, it takes something monumental to (a) attract all their attention and (b) stay in the collective memory. If he has an accident, it won't make the news. So if he can bear to raise his hand ask to go, most classmates won't even notice.