See proposal linked in parent bug. This will involve removal of smartpix and reshufling of images.
New $PAGE->image_url($imagename, $component='moodle') which returns URL instance which fully replaces old_icon_url() and mod_icon_url().
I think we should also add __toString() to the moodle_url class which would make the conversion much easier.
We might also add moodle_url::out_raw() which just returns unescaped URLs that are needed in JS code - the three parameters are horrible when all you need is just unescaped "raw" url imho