> that translating eg. GPL Python or C++ into C would mean the license is retained
It depends a bit on what exactly "translating" means but you could easily be a derivative work.
Honestly in that situation I wouldn't even look at the code. You might use in to test equivalent behavior after you have your own implementation, but only in a gross sense.
Don't sell yourself short. This is the sort of thing that is only straightforward if you have the right background.
My favorite is the McLeod Pitch Method/MPM. Runs fast enough for realtime purposes in a WASM example too: https://github.com/sevagh/pitchlite
So I have been staring at your code for many hours, and the YIN-implementation works well. The PYIN on the other hand.. well I necro posted a while ago in one of your pull requests I think ;)