Backport 1.7 3800

Backport #3800: `BUG: fix hashing of long integers under python3`