I have no idea whether there are any APIs the Play Store has access to which expose that feature, but through ADB (or directly calling the package manager from the shell of a rooted device) you have been able to instruct Android to keep the app data even after uninstalling for a long time already.
(I haven't actually tried whether you can really successfully switch signatures on an APK that way without losing all user data, tough)