If your use case can have C++, then [std::from_chars][1] is ideal. Here's gcc's [implementation][2]; a lot of it seems to be handling different bases.

[1]: https://en.cppreference.com/w/cpp/utility/from_chars.html

[2]: https://github.com/gcc-mirror/gcc/blob/461fa63908b5bb1a44f12...