These two are apprerently the most concise and efficient way to convert int to/from bytes in Python. The alternatives are struct and array modules, but methods using them are more verbose in Python code and less efficient in memory/cycles.