I remembered reading about a bikepacking adventure in Bike magazine years ago. They had similar experiences with the locals as did the author in the OPs' story.
I googled it to see the date and it was 2013. While I googled it I saw several other stories about traveling through Afghanistan by bike. Read a bit of them and the same theme. Locals were friendly, curious, and generous and the Taliban were watchful but not cruel and actually supplied tea and even food to the cyclists.
I'm not saying it's not dangerous but I've read many stories of people bikepacking in remote areas all over the world and their interactions with the citizens has been overwhelmingly positive. I did read one about Russia where the guys tried to ride into Siberia and were turned away by rifle toting guards.