BUG: fix header using symbols not available in py3

Inside numpy we handle this via the py3kcompat header which is not
really public api. So for our public headers we need some explicit
checks.
Merge pull request #5257 from juliantaylor/py3-header-fix

BUG: fix header using symbols not available in py3