Thanks, your code works, and helped me figure it out.
I had two problems.
SvPOK_on must be called at some point, otherwise, even though it contains data, perl doesn't 'know' that it contains data. Also, I wasn't setting the SvCUR_set, which makes perl think I had an empty string.
I went through several variations on this theme, but all of them were missing that key piece... which makes perfect sense after reading perlguts a bit more carefully.
perlguts doesn't cover the writing of strings as fully as it does reading. I went through the same confusion -- earlier versions of one of my XS distros, Sort::External, performed unnecessary copy operations before I figured it out.
Spelunking sv.h and sv.c in the Perl source can be very helpful.