This improves the API slightly, and will make future electrum backports easier (I want to try [[https://github.com/spesmilo/electrum/pull/8041 | electrum#8041]])
https://github.com/spesmilo/electrum/commit/16e4827e8c6db833b0a969351b73eb34d489681f (refactoring ecc.py)
https://github.com/spesmilo/electrum/commit/4f9e4c520f29bfffd51738213bebfb514967e7ba