A .22 rifle with CB rounds will do the job quietly and efficiently. No need for a BB gun...
Check your local hardware store. They are available in .22 LR or .22 short.
About 20 years ago I lived on a 58 acre horse-boarding ranch. There were ground squirrels everywhere. One day the ranch hands decided it was squirrel shooting day and dozens were killed with .22 rifles. But a piece of one of the bullets ricocheted and embedded into a horse, hundreds of yards away. So even if you are acres away from your neighbors you could still end up putting lead into someone or something you don’t want to. Stick with the pellet or bb guns, they’ll do the same job and you won’t get sued by your neighbors.
Might as well get a Henry lever rifle for kids in 22lr. Will shoot shorts, longs, long rifle and subsonic 40 grain bullets reliably. Too much fun for kids so don’t share it witht he grandkids ... just sayin’