At a safari lodge in Zambia I met 2 women one French one Dutch that were cycling from Addis Ababa to Cape Town, this was a few years ago you probably couldnt do it now.
Chatting to them about security, no problem, they stopped at the local school every night, there was always someone who could speak English or French. They were always offered food and a guard for the night, as any guest would. This reflects my experience of local populations, friendly, law abiding and keen to show you their way of life, however humble it is.
The locals of course know who the local trouble makers are and any incident involving “guests” would bring swift and very painful justice.