I think there is only little freedom. Floating point operations always allocate memory. Integer operations do not allocate memory as long as the result fits into 30 bit. Then memory must be allocated to store the result. Example on a LoPy: >>> f2 = 2 >>> for _ in range(32): ... f1 *= f2 ... print(_+1, end = " ") ... gc.mem_free() ... 1 37408 2 37408 3 37408 4 37408 5 37408 6 37408 7 37408 8 37408 9 37408 10 37408 11 37408 12 37408 13 37408 14 37408 15 37408 16 37408 17 37408 18 37408 19 37408 20 37408 21 37408 22 37408 23 37408 24 37408 25 37408 26 37408 27 37408 28 37408 29 37408 30 37344 31 37312 32 37280