Bob gave you a long speech, which he most likely gave to many different people that day. This is a sales speech. A con artist is simply a salesman who went to the dark side. Instead of selling a product, he sells good feelings: if Bob is a good con artist, after he milks you for cash, you'll feel like a saint for helping him feed his twelve children! Look, he even has pictures!
Bob doesn't look like a random bum. In that case you'd give him a buck or just a smile to acknowledge he's still a person even though he smells a bit funny, and that's it.
So I'd cast Bob as a businessman. Bob aims to be efficient, and collect the maximum amount of money in the minimum amount of time. This means he has honed his target selection skills: it is in Bob's interest to select the right target and not lose time with people who won't pay.
Thus the best way to get rid of Bob is to signal that you're a tough target. There's no need to be rude or anything:
Bob: Can you help me?
You: Girlfriend's waiting, well I guess I can be a minute late.
This gives Bob an extra problem: he will have to convince you to stay long enough so he can deliver his sales speech, while knowing your GF is waiting. Bob will reassess his chances, ask where to find the pet store, and leave you alone.
In this scenario, you don't know Bob is a con artist. He might just have been a random guy looking for the pet store and you helped. Good for you ;)
Bob: Now followed a (somewhat) longer monologue about helping people. Sounded to me like a crowdfunding-related marketing text.
The longer you spend listening, the more Bob will view you as a gullible sucker. So when you guessed he was gonna ask for money, or maybe pull some marketing trick, or ask for a poll or to sign a petition... You should have interrupted immediately at this point with "Thank you, but my girlfriend's waiting, I don't have the time. Have a nice day." Then leave.
Don't say you're broke, don't talk about money, don't weasel out, don't whine, you don't need to explain any more than that. It's really simple. Tone is important, you should cut him off with a raised hand, be assertive, maybe frown a bit.
Let's be honest, you don't care about this guy's feelings, you're simply looking for a way to get out without making him angry, and this is a good one.
Now, I will add some street smarts to the other answers here:
Stranger: Well, there is an ATM right around the corner/in that gas station.
Bob looks over your shoulder as you enter your PIN code. Then he produces a surprisingly large knife and begins to act unfriendly. You surrender your credit card, he has the PIN, and while you're at it your phone and your wallet. In the next five minutes, Bob busts your CC's cash withdrawal limit, then empties the rest of your account by purchasing bitcoins online using your phone.
You can keep the knife that's planted in your gut ;) it's on the house.
Stranger wants to walk you to an ATM = RED FLAG!
If I genuinely don't have any cash, I take my wallet out and open it up and show it to them.
He grabs it and runs. Your credit card is inside. He doesn't have the PIN, but he can still purchase bitcoins online.
Other answers suggested saying that you don't carry cash. I would advise against it, because while it can work sometimes, it can also backfire if the person simply asks you to buy something.
OK, he takes you to the tacos truck and buy him some. You got no cash, so you pull out your credit card. That's when you realize he wanted tacos because running away from a taco truck is a lot easier than from the inside of a shop.
If you want to give him some cash, put your hand in your pocket and pull out a few coins. Exhibiting your wallet in front of someone you suspect to be a potential thief would not be a very good move.
Do not pull out your shiny new iPhone to look at the time when you say you're late to meet your girlfriend either.