There is no lock in, you can use avr-gcc with Arduino boards. Arduino is a portable SDK with HAL, you can add support for your own devices to it pretty easily
Most vendor lock-in isn't "it's impossible to do the thing" but "it's hard enough to do the thing any other way, so this is effectively the only practical way to do it"
I put together a simple setup to skip the arduino ide on an AVR design, but still be able to use their serial.println and other utilities. You can use it side by side with manual register masks for enabling IO.
How so? It uses bog standard avr-gcc and avrdude. There is nothing stopping you from using those yourself.
What's hard about it?