Shortest python3 code for: Find the difference between a number and a power of two not exceeding a given number
Python 3, 39 bytes

print(int('0'+bin(int(input()))[3:],2))

Try it online!
Subtracting the largest power of two less than a number is the same as removing the first 1 from its binary representation.
Unfortunately python rather mysteriously errors on trying to convert the empty binary string to an int so we need '0'+ if we want it to work on zero or one.  If we relax the requirements to only require two or more then we can remove 4 bytes.
Python 3, 35 bytes

print(int(bin(int(input()))[3:],2))

Try it online!