before coming out/figuring out I was trans, I found a good compromise was a blazer over jeans & a plain top with formal shoes. Admittedly now that outfit looks noticably girly and I don't feel comfy in it any more, but if you're still needing to put up a show of presenting as they expect of you it's less traumatic than a dress. If jeans (even black ones, or cords) aren't formal enough any plain black trousers should work, and you can still have a bright coloured top with it if they go with that requirement.
If they do decide to require a dress/skirt, which they might if it's super-formal, maybe treat yourself to some new comfy boxers (nobody has to know!), use leggings instead of tights (they're basically like longjohns right? Plus bonus: no shaving required) and bring a more comfortable outfit to change into once you're done.
I'm now going to go see if I can take my own advice since I've got a theatre trip tonight and don't really have any guy-shaped formal wear either.