With regard to homeless folks, or anyone asking for money on the street, I think you just decide if you are willing and able to provide. If so, go ahead. If not, don't. If you feel the need to say something you could try "Sorry, I don't have any cash on me" or something like that and continue to walk away. If someone is violating your boundaries for any reason, you need to leave the situation asap. If someone blocks your path or you feel unsafe, call the police.
I wouldn't speculate about people's life choices or why they are asking for money or if they are deserving or not. We never truly know what is going on with a stranger. I either have money to spare or I don't. I don't analyze the reasons of folks asking for money.
Hope this helps. Good luck and stay safe