It would help to have an implementation of
fmemopen(). This routine is described in POSIX and, perhaps more importantly, is available in glibc and all of the BSDs. Of particular note, Samba 4.10.0 has come to depend on this function.
When implementing this function, it may be worth considering an implementation that would get us the funopen suite of functions that the BSDs provide as well.
Note that at least in gnulib, a terrible, horrible, no good thing has been done: a local definition of what should have been an opaque structure has been included in lib/stdio-impl.h -- we'll need to be careful that any changes to our stdio implementation don't move these members around or change their meaning.