If you intend to enter any temple, and let's face it, you're in Myanmar so of course your going to go into a temple or two, you need to think about what you are going to wear. There are strict rules in place prohibiting footwear of any description when entering temples, including socks, so be prepared and wear footwear that you can walk around in for a long time but can also take off and put on easily. And don't think you can get away with it because a temple appears to be deserted. Many of them, especially in the Bagan area, have family guardians who will enforce the rules. If you're not used to this, it can be disconcerting walking around bare footed in an ancient temple that's completely open to the elements, but you do get used to it quickly.
I ended up wearing either flip flops (thongs, jandels whatever you want to call them) and my old faithful converse trainers which got so wrecked I ended up binning them on the way home. Don't even try to wear socks. It's especially important to choose your footwear carefully in Bagan if you're planning on temple hopping. The two most popular forms of transport to move between the thousands of temples are bicycle and E-Bike (an electric scooter/moped). If you're not comfortable riding these, you're likely to put your feet down whilst travelling (and even if you are comfortable, the ground is extremely sandy and rough), and this can be dangerous if you're not wearing footwear that provides sufficient protection.
There are equally strict, although somewhat more vague, rules about what you wear above the feet. Most temples will require both men and women to cover their knees and wear tops which at least have a small sleeve (i.e. a t-shirt). My other half found that his knee length shorts were fine, however my above the knee shorts were not. Wearing trousers is an option but heat becomes an issue as South East Asia is hot and sticky especially when you are travelling from the rainy UK and not used to it. My thin, cotton, haream pants became my saviour on this trip (they also kept the mosquitoes off my legs), although on the hottest days I ended up wearing shorts. The best thing to do is either buy a Longyi or carry a wide scarf in your back pack so that you can wrap it round like a skirt when needed.
Speaking of back packs, having one is handy if you don't want to leave your shoes at the temple entrance (although bring a plastic bag in which to put your shoes so as not to get dirt in your back pack) and to carry water, which you'll need (there are small markets located near the largest and most popular temples where water and other drinks can be purchased). Some temples do have clothes you can loan whilst walking round if needed, there are also loads of locals selling 'elephant pants' this seemed to be a must have for any backpacker in South East Asia, I ended up buying a pair (even though I was not backpacking), and they were great.
Before going to Myanmar I was also concerned about offending the locals with my western clothing, particularly as a women in a fairly conservative country. I need not have worried, there were loads of people wearing shorts above the knee but not too short and vest tops, just don't go too skimpy.