For the sake of drama, if a hero's access to guns is unavoidable in a fictional milieu, writers will tend to use the plot to defang their effectiveness. However, such ruthless efficiency doesn't usually serve fictional plots very well.
Their cost-efficiency, lethality, range, and passable ease of use is unmatched. Firearms are the best personal weapons humanity has developed to date.