I would say the final option. At least for me, one reason for my bodybuilding was a way to divert and ignore those feelings. Of course, there was something wonderful about the bodybuilding culture, the dedication, comraderie, and seeing the physical transformation and mass acquisition...but for me it really was part a rouse, a way to get people off the scent and accept me as a man's man.
Although I was on the smaller size for male bodybuilders (5'6", 175 lbs), even 10 years after the fact it's still hard to shed the muscle (even at a current 145 lbs); one problem I've encountered is I still have alot of muscle memory (mesomorph physique) - recently I spent several months relocating between cities, necessitating alot of packing/loading boxes, breaking down/reassembling furniture, etc, and seemingly out of nowhere the striations and vascularity was returning (friends who were seeing me off commented that I must have gotten back in the gym). Yes, there are women (XX) bodybuilders - but their intrinsic bone structure is generally distinct from an XY individual, and so even if they're ripped to the gills - they still will generally have a different appearing physique.
It's nice to see other (former) bodybuilders on this site.
(One other option I'll put forth - it was a socially acceptable way for me to swap eating disorders - from starvation bulimia to exercise bulimia...a 'man' spending two hours/day in the gym 'pumping iron and gettin' huge' was OK; a guy sitting in the corner, eating 750 calories/day is not. Bodybuilding was a way to force me to eat, oftentimes incredible amounts of food and protein (usually 200-225 grams/day), but it eventually spiraled out of control...again, body dysmorphia, gender dysphoria, highly competitive personality...yeah, not a good combination...in my starvation bulimia days I had internal, personal challenges to see if I could crack the sub500 calorie barrier, and for how many consecutive weeks).