More generally, I would suggest that any "consent" citizens give to cops in such situations shall be presumed coerced, absent clear evidence to the contrary (and citizens have the right to have questions of coercion decided by a jury that would be informed that if they find that evidence was obtained through coercion they should not construe it against a defendant).
This rule basically exists. "coerced" statements are excluded from trial via pre-trial motions.
questions made during custody (or the state of "not free to leave" which implies a non-consensual encounter that does not involve being handcuffed) where no advice of rights are given are assumed to be involuntary and also excluded.
The issue boils down to when and why would the 'reasonable person' believes they are not free to leave and that analysis turns on the testimony of the officer and the person charged as to how the encounter transpired.
the uniform itself is found in some jurisdictions to make an encounter custodial unless the officer makes statements which clearly indicate that the encounter is simply and "accosting" with the other party being free to terminate.
the words used by the officer "may I ask you a question" vs a confrontational inquiry such as an immediate question like "how long have you been here" also figure in.
The problem is that most judges see the first question for what it is between two civilians...a request to have an interaction which can be declined.
the reality is that uniforms make people nervous in today's society and even the request to have consensual interaction is intimidating to people who don't know their rights.