Is one of the stomach functions is killing bacteria?

Most definitely! Our stomach contents are highly acidic, which not only helps to break down food but also destroy bacteria and other foreign agents that may harm us.