PS: i dont mind my system being unusable until fixing it, doing nothing critical on it. I also see this as a learning experience.
Basically at this point i have significant free time and messing with c compilers and libraries looks like fun instead of a chore
As
tembun already explained,
writing C programs yourself - being already pretty versed in C programming is a given before one even thinks of such a stunt - and compiling the one or the other port with a different compiler - for which you pretty well know why you're doing that - is a
huge difference to changing the pillars your world stands on.
Of course, this will teach
a lot about C programming and the system, of course.
Question is, are you aware of the scale of this job you have in mind?
If this is really what you want to dive into, my recommendation was: Build your own system. Don't get me wrong: I do
not want you to leave FreeBSD. For sure not. In contrary. But IMO that task was better to achieve bottom-up instead top-down - start by scratch on an empty sheet, instead of ripping down a large, coherent, complete and complex system to its foundation, and then rebuild it again. That's putting the cart before the horse. If you want to learn how aeroplanes work, you start building simple gliders first, then attach motors, etc. But replacing the wings of an airliner just to see what happens will not teach you much, except that thing will either not even take off or crash, Duh!
Particulary before you start messing and risking your system - naturally you already have a bullet proof backup routine, of course. Nothing really ever can happen, except you spend some time to restore, right? - You need at least one reliably running system.
So, build a second system parallel: on another machine's hardware, in some VM.
Get some kernel sources (some old FreeBSD kernel, maybe NetBSD, maybe an old Linux kernel, if available maybe minix... - what you can get, what you like - the smaller and simpler, the better. Start small - bottom-up.
See to get it compiled with the C compiler of your choice. Then pick a bootloader (again, compile it.) Then see to get a running system: the bootloader you compiled loads the kernel compiled by yours. It will be not much to use, but that's not your point anyway - you wanna learn how the things work. But it was a crucial start anyway. Next will be the software packages you need and want to make the system useful: Those also need to be compiled with the compiler of your choice and get them running under your system.
I believe, this way will teach you more, better and faster, what you want to learn, with way less trouble.
Start some journal/blog to write down what your goals were you gave yourself, what you did, how it came out, and what your conclusions are for each step, was not only interesting to others, but above all very helpful for yourself. And anyway it will record your successes, no matter how far you get.