I found that using ClockBlocker I can succesfully solve my problem with black screns and BSOD when idle with my RX 470.
However, I also found that after installing the latest drivers, Windows 10 takes too much time to boot (almost 5 minutes). I thought of buying a SSD to speed up booting times, but they are expensive and the cheaper ones have low capacity. Also, before ClockBlocker can start automatically I experience black screens, BSODs and the system gets very laggy, so I have to restart my PC several times.
That's very annoying. I'm pretty sure the problem lies in abnormal clock frequencies or voltages while the GPU is idle, and they could be solved with good drivers or BIOS updates.