Disabling bluetooth on a sleeping Mac, or: "Why the fuck is this not a setting, Apple? - Part 73"

Here's another addition to my ever-growing collection of "things that should be simple but require scripting because Apple knows better than you." Bluetooth staying on when my Mac goes to sleep. The Problem Often I use my wireless headphones around the house while doing chores, and when walking the dog around the block. And it is super annoying when I go in and out of the bluetooth range of my…