Same as weed seeds, I would not count on the temps during composting to be hot enough to kill anything. Course I mix, stir, and use the finished product without benefit of thermometers etc.
Because I do not know what has been composted I will not get the (I think still free) compost from the city landfill either.
you could end up with pot ‘weed’ plantes that way, a friend of ours got the city stuff, and they ended up with pot plants...they are older people and didn’t know what was growing in their yard.
I have volunteer cherry toms, and they grow better than the ones I buy or try to grow myself. They only get part sun for the day. Mine now because of the temps look like dried up weeds, despite generous watering. Keep trying to keep them to a few, but it is hard to keep them thinned out. Only good for salads and such, where I want to freeze quarts of toms, instead of buying cans of them.