I'd replace the `*2` with a `<< 1`, which will speedup things a bit in CPython at least.