Yes, it’s safe but it has its disadvantages.
1.- Shorter life span
Due to constant spinning mechanical parts will start to fail earlier. This is just how stuff works, things wear, tolerances broaden, things break. Most popular brands of hard drives will last a long time, if you take care of them. My thoughts on this, is have one small fast drive for the work and large drives for storage, which will be powered down most of the time. This way you use them efficiently.
2.- Damage to platters
If bumped when when mechanical parts are moving then you will risk irreparable, way too expensive, damage. Some laptops have an accelerometer that deactivates the HDDs, or move the heads away, when it's in free fall. I don’t know if this feature is available for desktops, or servers.
3.- Electric bill/ Laptop battery
It will draw more power, plain and simple. The power consumption will vary according to physical size, storage technology, etc; but in the end it is going to take its toll on your bill, or battery.
Do it if you need to, otherwise leave it be: it's just a couple of seconds.