Text this: Physics of swimming and its fitness cost determine strategies of bacterial investment in flagellar motility