Instead of the backpack, would something like a top-tube bag be more accessible?
https://www.universalcycles.com/shopping/product_details.php?id=102959&category=269
That kinda flies against the opinion from Alien Gear:
https://aliengearholsters.com/blog/concealed-carry-for-bicycle-commuters-and-recreational-cyclist/
EDIT: After thinking about this some more, I do think having the pistol on the bike is a bad idea. Ignore my first suggestion; you want it on your person somewhere. Visibility vest with an internal pocket?