In the end, this is about economics and trade-offs. While the code is technically sometimes both inefficient and inelegant, there are too few people who work on it to make re-writing code a good use of our time. If GnuTLS was a larger and funded project like OpenSSL, NSS, or OpenLDAP, things may be different.