One method I think possible is at the XS level. A simple scalar is stored as SvPV internally by Perl, which looks like this:
SV xpv
+--------+ +-----+
| ANY |--->| PVX |---> char[]
| REFCNT | | CUR |
| FLAGS | | LEN |
+--------+ +-----+
To do an immediate swap without copying strings, at XS level, do this -
SV xpv
+--------+ +-----+
| ANY |-+ ->| PVX |---> char[]
| REFCNT | \ / | CUR |
| FLAGS | \ / | LEN |
+--------+ \/ +-----+
/\
SV / \ xpv
+--------+ / \ +-----+
| ANY |-+ ->| PVX |---> char[]
| REFCNT | | CUR |
| FLAGS | | LEN |
+--------+ +-----+
I can provide an XS example if you are not sure how to do this at XS level.