Yeah, boxers only is a no go in a mixed dorm, so good instinct there. Gym shorts with no shirt is super normal in hostels. You’ll see way worse, trust me.
Most people just want to sleep and don’t care what you’re wearing as long as you’re covered and not making it weird. Shorts and no shirt is pretty standard, especially in warm places. If the dorm is cold, toss on a tee or hoodie and call it a night.
Main rules are just be clean, don’t walk around half naked, and don’t linger changing. You’ll be fine.