This would be very cool and would simplify a lot, but I don't know how to do this. Here is a question on Rcpp repo RcppCore/Rcpp#1439 (reply in thread)
In meanwhile we have serialisation (disk-write-and-read) in place between R and reticulate Python (both ways) via ts_py_to_r() (see https://github.com/HighlanderLab/tskitr/blob/020cc396fbf5a6a710d3ded6345bcb2ce308f5b2/tskitr/R/tskitr-package.R#L282) and ts_py_to_r() (see https://github.com/HighlanderLab/tskitr/blob/020cc396fbf5a6a710d3ded6345bcb2ce308f5b2/tskitr/R/tskitr-package.R#L247)