MAINT: f2py: rewrite fortran_doc

This fixes part of #5044. Don't wait for me to fix the whole thing.
Those introduce new problems since they don't guarantee to NUL-terminate strings.