I imagine they've used the exact same method that Bitcoin uses, which means you could do some copy-pasta funny business directly from the appropriate section of Bitcoin Core's code, providing you're either writing C++ or that the pertaining portion of the code is valid C, in which case you could use C instead (not much consolation seeing as writing good C is arguably even harder than writing good C++)
AFAIR, BIP 340's use of schnorr sigs over the secp256k curve was previously not something anyone else had done (at least in publicly available code, I believe schnorr signatures were still patented in the early days of Bitcoin, and so segwit v1 was one of the first widespread uses of schnorr sigs after the patent expired). with that in mind, there's probably no better place to go than BIP340 and it's implementation in the Bitcoin Core codebase
I didn't read the entire nostr protocol documentation. In fact, I stop when they send us to that link I posted in my original post. It goes to a depth I didn't want to go.
However, after searching a bit more, I found an example code for schnorr over secp256k1 in Bitcoin Core github repository. I was able to compile it and run the example, giving me a pair of keys that are working in nostr!
There are some other nuances in the nostr protocol that changes the keys so that they are a bit more readable by prefixing a few chars and probably a few other mechanisms, but I think I don't even care about those.
For now, I just want to experiment a bit this protocol.
the example from Bitcoin Core repository I found and used is this:
https://github.com/bitcoin-core/secp256k1/blob/master/examples/schnorr.c