In the python case, pypy removes this cost whenever it can. The less you use dynamic features like duck typing, the faster your code gets.