Jeve, you ask a very interesting question.* I've read this question from others and I really don't know the answer.* I'm sure some chemist or botanist would.* I would think that the process of washing the veggies that haven't been grown organically and then composting them would make them safe to eat.* The runoff from the street would give me concern due to the petroleum waste from cars.
You could have your soil and/or compost tested for chemicals and metals.* Contact your local extension service if you are in the US.
When weeding, the best way to make sure you are removing a weed and not a valuable plant is to pull on it. If it comes out of the ground easily, it is a valuable plant.