Hi Anton, Nicolas, et al, I'm in favor of tidying up the priority-related code, as I also have found it hard to follow.
But please do not change the API of these functions, i.e. the signatures and return values. Their output is used in other packages, including some of mine like org-rifle, org-super-agenda, and org-ql. If the API were to change, it would create significant headaches in writing compatibility code for different Org versions. I can't easily tell if that's something that's been proposed, but I'm making the request just in case. Thanks, Adam