"You want to make a native module for CircuitPython" as of 25 Aug 2022.
Short answer: copy what
rainbowio does. It does everything the below describes and is known to work well.
What we'll be changing
Let's assume your library is called
chicken, with no port-specific functionality, and a single function called
bokbok(), that takes an int and returns an int.
Your CircuitPython code to use it would look like: