For reference: There is the well-known argument, especially in the U.S., that you should not talk to the police, like here https://www.youtube.com/watch?v=d-7o9xYp7eE in one of the extremest forms. There are lots of videos online of people being stopped in their cars and then going on for 30 minutes to "plead the fifth" while the cop asks the same question over and over again. For example, in the U.S., the key words seem to be "am I detained, am I free to go"; and by the way they are always used exactly like this, I assume they are not just randomly used, but with some kind of precedent.
Question: What kind of information is a police officer in Germany allowed to ask, in random situations on the street, i.e. during a traffic check? Presumably name and address, and whatever is on the Personalausweis? Is there a particular (verbatim) sentence that can be used in German if you do not wish to answer a question, without making yourself suspicious?
As a very concrete example: I was stopped in a generic traffic check once, late at night, in a very peaceful area where nothing ever happens, and was asked where I just came from. I truthfully answered "from the gym" or something like that and that was it. At the time, it seemed simply like small talk; they were friendly, I was friendly, they had a look at my documents, and we were done with it. But it certainly was the kind of situation those U.S. videos seem to be about; i.e. I could pretty easily have been forced into a situation where I had to lie or implicate myself, without even knowing.
I know that there are political groups with very strong opinions in Germany who will tell us to not utter a single word to an officer, but would prefer to know what the judicative has to say on this. Are there well-known precedent cases? Are there official formulations which are recognizable to an officer to mean "I am aware of my rights, and would prefer not to make an issue of this, but don't want to keel over right away"? Or is this more of a cat-and-mouse game, usually? Is there a (publicised) policy about this in the police community?