The issue is not how much of a safe background you have to have to be shooting RB into the air, but are you going to make sure you have a safe BACKSTOP for that ball when you fire. In Hunter Safety training courses, students are taught to not take " Sky line " shots. We are talking about shooting at an animal that is silhouetted against the SKY. That would include squirrels, with any kind of rifle. Line up your shot so that the ball will strick a solid tree trunk or thick branch after passing through the squirrel, or missing it. Only if you have a safe BACKSTOP to catch the RB should you consider firing the gun. This applies to both rifles and handguns.
If you are shooting a shotgun at squirrel in trees, the drop zone is measured in hundreds of yards, and you are actually less likely to injure someone by shooting at squirrel silhouetted against the sky. We have squirrel hunter shooting other members of their hunting party because they were shooting at squirrels on a low branch, or on the side of a tree, or branch, and forgot that their buddy was only a few yards further down that ravine, or creek bottom when they fired. The Blue Sky Rule applies to shotgun hunters, where the opposite rule has to apply to handgun and rifle shooters. Be Safe, and you don't have to worry how far that .40 cal. RB will travel.