How to adapt `Magento\Catalog\Model\View\Asset\Image::getUrl()` to Windows in Magento < 2.3?

How to fix the Magento 2.2.x image URLs bug in Windows?