I've done different things depending on the locker room. At my current gym, I'll walk with my towel in front of me. Sometimes I'll realize I need to pee before getting into the shower, so I'll leave my towel on the hook and walk naked to the urinal. In my previous gym, there were lots of naked guys walking around since it was an open shower area, so I'd occasionally leave my towel in my locker, or sometimes I'd forget to even pack one and I'd do my business nude (shower, sauna, urinal, sink) and finally dry off using paper towels. There were a few other guys who'd do this too. In college, I'd take a locker close to the showers, so I'd just leave everything in the locker and walk nude. The bathroom was further away, but I'd go there naked too. Occasionally I would get a boner, and with nothing else to cover up with, I'd nonchalantly just grasp my head and shaft in my hand and hold it to the side and keep walking. There was actually one time I got locked out of my locker naked and an attendant came in to help me (posted that story elsewhere) but other than that, no problems with doing this.