[WIP] add extra string handling functions

This is WIP, I'm just putting this in a PR so other people can look and give suggestions.

ref: #859

We need further requirements, like `bufsize > 0`, otherwise `cpy` could get big if `strsize >= bufsize`.
Then we could always `NUL` terminate without the `if` check.