Mushrooms are the fruiting bodies of soil-dwelling fungi. There are some beauties right now, aren't there? You are correct, without expert identification, wild growing mushrooms should never be eaten.
Whether to compost or not depends on how you feel about these mushrooms. Personally, I like them, and so I do compost them. On occasion, there will be viable spores on the gills, providing the opportunity for additional fungal growth in the soil, and perhaps additional mushrooms. But if you do not like them, putting them in the yard debris bin is just fine. Up to you.