I don't do small talk very well and I very quickly run put of things to say to someone I don't know so I don't like to just talk rubbish with someone, I prefer to remain quiet and get on with what I am doing.
I don't mean that the person isn't worth talking to or I don't like them, if they need something from me or have a question then I'll galdly answer or help them, but almost everyone takes it as a slight against them when i dont want to engage in idle chit chat and assume I'm an arsehole when I'm really not trying to be.
No. You're not mandated to listen me ramble about free will, artificial intelligence or simulation theory and I'm not mandated to listen your thoughts about the weather or see pictures of your child.
Conversation is a two way road so when you notice that it's only flowing to one direction then take the hint and move on.
My trick is earbuds. Even if I'm not listening to anything. Also helps to be living in a country where you're not generally supposed to go talk to strangers