On the line where it shows error, you have used .decode("hex"). It means you are treating the string as hex data.
To get the proper result call int with a base 16, like this: int(your_string, base=16)
Output using python 3.6.1:
>>> a = '0x00000000000000000000000000000000000000000000000bf97e2a21966df7fe'
>>> int(a, 16)