Well, M.2 Drives are definitely the smallest form factor of drives we have, besides like the super tiny USB drives. If you're interested in something quirky, multiple M.2 drives, multiple USB drives with
some sort of controller/hub, or multiple SD cards
with some sort of controller/hub would have a uniquely small footprint for sure. Probably not ideal value in any of those cases.
Practically, 3.5" HDDs probably have the best value. The issue is that space-efficient storage solutions for them have their own premiums. You're going to pay a lot to build your own system to manage the drives and get a case, and in a lot of cases, you'll end up paying extra if you want hot-swap bays whether it's adding them through 5.25" bays or buying a case with several hot-swap bays built in. Four 2.5" drives can hot-swap in one 5.25" bay which is pretty neat, but 2.5" drives in general are worse value than 3.5" drives.
Ultimately, on the general consumer end, it's best value to purchase a consumer-oriented NAS that can accommodate as many drives as you need or would feasibly want to expand to. I don't like the "one-size fits all" feel of that solution, so I never researched this option, but I do recognize and respect that it's generally the right choice.
If you need ~30TB, 8TB external drives can be had for I think ~$150. In most cases, these are just fancy plasticky enclosures for proper 3.5" drives. They're normally slow, and cracking the enclosure open to salvage the actual hard drive usually voids the warranty... but as long as you're doing some sort of redundancy and can accept a failed drive as a possibility, it's pretty compelling cost-to-capacity. There's a lot of reasons external drives have lower cost, but from what I can tell it has to do with weaker warranties and assumptions built around more "general public" users just not being compelled to put in effort to troubleshoot or seek support on problematic products.
So, that said, you'd be looking at about $600 for the base amount of storage you'd need (with 2TB extra), probably something like $200-300 for an enclosure, and it would probably be a good idea to get one or two extra drives for some fault-tolerance. Most of the consumer NAS solutions have pretty friendly interfaces, low power consumption (~25W TDP), and support RAID 5 and 6-type solutions.