Yeah, no need for Python. Even the following seems to work fine:
$ printf "%d\n" 003
3
$ printf "%d\n" 003
3
$ printf "%d\n" 009
sh: 1: printf: 009: not completely converted
0I love when programs mysteriously fail when passed an IP address like 192.168.001.009.
Thankfully modern tools have been moving away from supporting that notation and are less likely to explode all over unsuspecting users.
$ printf "%1.0f\n" 009
9
$ printf "%1.0f\n" 00125990
125990
$ printf %d 010
8