Don't put the return type in the function name.  I think this should just be `mcnp()`  Also, it is fine to separate out the string creation into another function, but you just broke API compatibility by removing the `write_mcnp()` function.  You should provide a very thin `write_mcnp()` function which calls `mcnp()` and then writes it out to a file name.