Since you are starting out, I recommend a Ruger 10/22, available for under $250:
Then buy a lot of 22 ammo:
1000 rounds costs about $60. I’d suggest buying 5,000 rounds for a start. That puts your total cost at around $550.
When you run out of ammo, you will A) be a decent shot, but not great, and B) be ready to spend a bit more for a higher power gun. But the 22 is the basis for good shooting, because it is the only way to shoot enough cheap enough to get good at shooting.
And if I was a bad guy, I would NOT want to face 10 rounds of 22 ammo fired in about 5 seconds. And with very little practice, you could aim for the face...
I plan on getting a sig mosquito tomorrow. I’m gonna have fun with this one.