Can I simply walk away?
Yes.
This would be classified as a “consensual encounter.” Just as any individual may approach you on the street to engage in conversation, and you are free to ignore them – the same applies with police encounters. An officer has the authority to try to talk to anyone, but unless they have “reasonable suspicion” that a crime has been, or will be, committed, or probable cause for an arrest or search – you are free to ignore them and go on your way.If the officer approaches you and engages you, simply ask the magic question, “Am I free to leave?”
If they say yes – then simply go on your way. If they say no, you are not free to go, consider yourself stopped, detained, and soon to be arrested. Exercise your right to remain silent.