The allocate-serialize-retry loop was ugly and inefficient, especially for large items that might take a number of tries to succeed
Will also waste less memory
The downside is that the old API doesn't match the new logic so well, the return value and the output parameter are redundant now. Given the number of clients (https://github.com/search?q=cbor_serialize_alloc&type=code), I will keep the function as-is for now since it is backwards compatible
Description
Checklist