Fixed by https://github.com/coq/coq/issues/14571
I checked that the test cases in #114 (closed) still succeed instantly after removing the workaround.