The first words out of your mouth should be: "Am I free to go?"
I favor politely refusing consent to the encounter itself as the first thing. "No offense, officer. I know you're just doing your job, but I don't consent to an encounter with you."
We have quite a few reports over the years of cops dodging the question, "Am I free to go?"
By politely refusing consent to the encounter itself at the very outset, you are throwing the legal ball into his court. Now, he
must have reasonable, articulable suspicion (RAS) to continue the encounter. (See Terry v Ohio and subsequent cases.)
Refusing consent to the encounter itself at the outset removes all doubt, closes all doors, to any question about whether it was a consensual encounter. As long as the cop can fudge the idea that you remained consensually, he has the door open to not needing RAS. As long as the cop can muddle whether the encounter is consensual, he can afford to have shaky or non-existent RAS. The really smart cops know this. They know they need the citizen's cooperation in answering questions and so forth, so its to their advantage to make an encounter seem consensual, just so the target cooperates.
Under my approach, if the cop asks even one more question after I refuse consent to the encounter, I just move immediately to "Why am I being detained?" It cannot possibly be a consensual encounter--the first thing I said was to refuse consent to the encounter. So, it necessarily must be a detention (or custodial arrest). Then, just liberally apply:
"Am I free to go?"
More, "Why am I being detained?"
"I won't answer questions."
Also, unless identity refusal is well protected, I would go ahead and provide it just to avoid arrest. If arrested, there's a very good chance your recording will magically disappear from the memory card. "Yes, your honor. He did have a voice-recorder. It was not turned on."
And, if you want to get creative, you can always ask "When will I be free to go?" Every once in a while a dumb cop will answer that by confessing to a rights violation. For example, "You can go as soon as you tell us what you're doing with that gun." Coercion to make you waive the 5A right to silence that you already invoked earlier. Such comments make nice ammunition when recorded.