Yuck! LOL
They are bugs & not worms? There are white worms that some people call "trash worms" that sometimes invade a tank especially if you've bought aquarium plants but if these are crawling bugs with legs I don't know what they might be. If it were me I'd try tearing the tank apart, disinfect everything & then wash the bugs off the turtle.
ewwww
good luck with this!
-----
PHRatz