Your version of newSVrv wouldn't work. Its only 5.12 compatible, not before, because of the SV type changes and the prepare_SV_for_RV macro changed. Can RVs have a PV string pointer (flags off of course)? Does an RV always have to be of type SVt_RV (5.10) or SVt_IV (5.12) or any SV with ROK can be a reference? The sv_replace seems like the safest idea while i'm writing this.
There is a missing refcount inc on sv before "SvRV_set(rv, sv);". Also there is a macro for the old RV sv type to IV, seems to me that it will provide backwards compatibility
sv.h#l75 in perl.git