It should be pretty simple. I did a similar job with Unbound for work. Took the existing Python extension capabilities and created a PR which added a similar interface just using dynamic libraries instead. Then I wrapped all the internal structures and procedures in Unbound using [Futhark](https://github.com/pmunch/futhark). Then it was just a matter of writing my DLL and so files in Nim with full access to what Unbound offered. Not only did the speed of my extension dramatically increase, but I was also able to access things in Unbound which simply weren't exported in the Python interface and I avoided all the C -> Python -> C conversions.
FreeCAD being C++ means Futhark isn't going to be able to automatically do the conversion, but creating some C headers for the dynamic library interface shouldn't be too much trouble.