If a police officer pulls you over and you start pulling the "I've been told never to talk to the police", you're escalating the encounter before it even starts. That's no excuse for police abusing their authority, but they've got the authority and you don't.
Lawyers have told me to use your best judgment. Cooperate as long as the police are being cooperative, and the odds are you'll go about your day with only minor aggravation. Only escalate to the "I don't talk to police" when they start getting hostile with you. This is, I'm told, what the lawyers themselves do.
This is for minor encounters, like traffic stops or ordinary questions. If you're actually taken in or you're a suspect, yeah, shut up and wait for your lawyer.
And, uh, this is the advice they give to me as a white man. It may not apply if you're somebody more likely to be subject to abuse.
None of this is good. It's very, very bad. This advice is not about fairness; it's about trying to make your life as least-worst as possible.