I'm not finding an API, but because it seems to delegate to OpenSSL, perhaps I'm not understanding how this works.
What I'm looking for is the equivalent of the first answer to this [1] but from within Python, using an RSA keypair that has just been generated and, for security reasons, has never been written to disk.
[1] How do I extract the private key components $N$ and $D$ from a private RSA key?