If you are willing to give up "pure" Python but gain a lot of firepower, there is Sage - example here:
sage: a = 15sage: a.binary()'1111'
You'll note that it returns as a string, so to use it as a number you'd want to do something like
sage: eval('0b'+b)15