When we drop support for python2, the following code can and should be simplified:
https://github.com/gwpy/gwpy/blob/2b4e780bd4323d6c150483bef253e3e0e7b7025e/gwpy/utils/decorators.py#L101-L119