A decent survival strategy would be to be poisonous and recognizably colored. If you look like any other mushroom, it's just revenge-poisoning. Possibly with the side effect of animals not eating any mushrooms, but that doesn't sound like something that's in a given mushroom species' interest.
Is Gandalf actually male though? I didn't dig deep enough into the lore to know that, but I do know that he is far different from your regular human/hobbit/dwarf-person. He does present as male, but that might just be a reflection of the societies he is more-or-less living in (i.e. the old wise man persona just makes sense for practical reasons).
Tea is good, too.