Earn an S rank on every mission on Hard difficulty. Doing so unlocks the ability to upgrade a weapon to level five, which comes with unlimited ammunition.
That is a steep requirement, and it is meant to be. The practical route is to learn each stage's enemy placement and boss patterns well enough to clear it quickly and accurately, since the ranking rewards speed and shots that actually connect. Aim for the head and use the environment to thin crowds before they close in.