For SATA and SAS, the answer is vendor- and model dependent. Yes, there are mode pages you can set that prevent a drive from spinning up when power comes on. Yes, you can spin-up and spin-down drives under computer control. To do that, you probably need to download the specific SATA or SAS interface manuals for the drives you are using. This functionality is supported for enterprise drives, but using it may require working with engineering groups from the drive vendor, you may have to get special firmware to enable full power control (which is pretty much only possible if you are a large customer, who buys drives by the thousand or by the million). A better option is to control power to the drive, see below.
Be aware that the power consumption of a drive will not go down to zero when it receives power and is in internal power-saving modes, and that drives typically have multiple power modes, with different power usage. The documentation will tell you. Ultimately, for typical workloads, you'll end up saving surprisingly little power.
For consumer drives, I hear stories of drives ignoring these settings. That's because consumers need to be protected from themselves: people play with their disks, they think they have a dead disk, they get mad at the manufacturer or waste the time of the manufacturers or sellers tech support people, when in reality all that happened is that they told the drive to spin down and not spin up any more.
Real-world applications of this technology at scale typically don't rely on the drive itself, but they put switching components (relays, transistors in the power distribution) into the drive backplane in the enclosure. Typically those switching components are then controlled by an enclosure controller (which in the real world is typically a SAS expander, doing double duty as a SES enclosure controller). I guess one could fake this with a Raspberry Pi and a handful of small relays, and a few hours of soldering. I've never heard of a USB hub that allows controlling the USB power lines, if your disks are USB powered, but such a thing might exist.
Beware that powering drives up and down tends to stress the storage software stack out a little bit, in particular if you do it while IO is running. A real-world implementation will need to coordinate this with the software stack, to make sure errors are handled correctly, and to make sure all the ancillary operations (such as mounting/dismounting file systems, running scrub, keeping track of disk availability and health) are orchestrated correctly. And also note that power-cycling drives can be a very good way to get misbehaving drives back to work; this often uses the same power control hardware that you intend to use.
The idea of spinning down disks to save power is old, and even has its own acronym: MAID, for "massive arrays of idle disks". The idea was not so much about power saving, but about being able to pack disks much more densely: if only a small fraction of the drives (and ancillary hardware, such as controllers and power converters) are on at any given moment, you don't have to allow for very much space for cooling, and you can make the power supply and cooling hardware much smaller and cheaper. This sounds like a great idea ... until you try it, and everything blows up on you. A lot of money was invested by venture capitalists into this idea in the mid-to-late 2000s, and the market leader (ha ha, there never was a market) Copan went under to great fanfare. The whole thing had been founded by a computer scientist from a university, and they suffered from "inhaling their own exhaust": they believed the stories their marketing people told them, that there was a great big need for such arrays. In reality, the rapidly increasing capacity of stock drives ate the opportunity. Furthermore, it turns out that disk drives really hate being power cycled all the time, and disk reliability went to hell. And finally, controlling everything in the software stack above the drives was way too big a task.
If you really want to do this and make it work reliably, you should expect to spent man-years on the engineering. Many man-years. Copan I think went through about $100M in funding before going under.