I've done a patch to do this https://github.com/mhughes2k/moodle/tree/wip-MDL_45242-master and raised a separate issue (https://tracker.moodle.org/browse/MDL-45242)
I think it should work without impacting anywhere else (e.g. the /admin/user.php page) since I've added a default parameter that cause the custom profile fields to not be returned unless explicitly asked for.
There's probably a lot of places that would need to be updated to accommodate the changes required to SQL.
Anyway it's a proof of concept...