toothbrush is no good, because the bristles are too soft to clean off the grime.
not even the toothbrush that you're not supposed to use on your teeth, the hard ones, are any good.
If a toothbrush is no good, then your cassette's are way beyond dirty to begin with.
About every 300 -500 miles I clean the cassette with Mr. Clean in a spray bottle, a toothbrush and water rinse. They come out super-shiny clean.
The chain also gets run through a rag soaked with Mr. Clean, dried, lubed, and wiped down to remove any excess lube at the same mileage intervals.
After every ride, the chain, cassette, pulley wheels and rings get run through/wiped with a rag until no dirt shows on the rag.
Chains and cassette's last me a very long time, and the major benefit is how much easier it is to pedal a clean drive train. Free watts for everyone.