If you read the NASA Club Codes and Regulations, you will find a section dedicated to what you should wear when you participate in HPDE.
Section 5.6 in the CCR outlines it as follows: “All participants must wear at least a T-shirt, short or long pants, and shoes (no open-toed shoes). Shorts in the pit lane are permitted except during sessions requiring refueling such as endurance racing. Some racetracks have more restrictive requirements.”
So, yes, you can wear shorts and a short-sleeve T-shirt when you drive in HPDE, but that’s probably not putting your best foot forward. Long pants and a long-sleeve T-shirt are preferable.
Long pants are better at protecting your legs. The risk of a modern production car catching fire in an HPDE is infitesimal given the lengths OEMs go through to keep that from happening, but long pants keep your legs from getting burned on hot tailpipes or steel that has been sitting in the sun. Also, if you have to do any kind of work on the car, it’s better to have long pants covering your knees.
Same goes for a long-sleeve T-shirt. The fabric helps protect your arms from hot stuff when you’re checking tire pressures, oil levels, etc. It also keeps you from burnishing your farmer tan.
The CCR says nothing about hats and sunscreen, although those are a good idea, too, especially if you insist on wearing shorts and short sleeves. Be careful with the sunscreen, though. Don’t apply it above your eyes or on your forehead because sweating while you’re out driving can make it run down into your eyes and burn them, which can end a session.
As for shoes, you might as well invest in a pair of driving shoes if you plan to do HPDE regularly. Racing shoes are minimalist, form-fitting, and they are better for working the pedals. For about $100, you can get a pair of Sparco Race 2 racing shoes from Competition Motorsport, which is downright cheap, all things considered.