Amusingly, that's unnecessary, but possibly not for the reason most people think. It's not because the hard drive hardware is oblivious to runs of 0s and 1s exactly... it's because it's actually so sensitive that it already is recording the data in an encoding that doesn't allow for long runs of 0s and 1s. You can store a big file full of zeros on your disk and the physical representation will be about 50/50 ones and zeros on the actual storage substrate already. Nothing you do at the "data" layer can even create large runs of 0s or 1s on the physical layer in the first place. See https://www.datarecoveryunion.com/data-encoding-schemes/

High-density NAND flash also needs "whitening", i.e. scrambling the data to be stored so that the number of 1s and 0s is even and randomly distributed, to avoid wearing some cells (the ones that are storing 0s) more than others, as well as reduce pattern-dependent disturb errors.

That said, digital storage media has been somewhat pattern-sensitive for a century or more: https://en.wikipedia.org/wiki/Lace_card

The self-synchronizing scrambler of 10GBase-SR and its relatives is a beautiful piece of engineering.

Interestingly, I heard that entrenched telco people were pushing for a much more complicated, SONET-ish approach. But classic Ethernet simplicity carried the day, and it's really nice...

this principle applies to a lot of things. signaling for example. optical links. oldschool optical links (OC48 timeframe) did not feature scramblers and so a malicious packet could on occasion cause them to de-train and go out of sync since it's extended loss of light.

long since fixed but a common problem.