Merge #777 'Constify text enc args fix mb_string2cells'
msgpack: NULL terminate incoming strings

It's a 1-byte loss of memory but it allows us to skip copying and
NULL-terminating strings when interacting with vim functions that accept C
strings. This lowers the pressure on the allocator and saves lines of code
(no more dup/free pairs).
api: remove some redundant string copies

Now that incoming Pascal strings are NULL-terminated by default, we can skip
some spurious copies.
api: also NUL-terminate Strings made from cstrs

I believe we can now mostly assume that all encountered String's data
members are safe to pass into functions that accept C strings. That should
simplify interop with C string code.
api: unify string conversions, simplify interop

- The data member of String's can now be passed directly to functions
  expecting C strings, as we now guarantee that they are NUL-terminated.
  This obviates the need to use xstrndup and free, simplifying code and
  enhancing performance.
- Use xmemdupz instead of xstrndup for converting String's into C strings.
  It's faster because it doesn't calculate strlen(string.data) (which is
  unnecesary as that information is already provided in string.size anyway).
- Use cstr_to_string to convert from C strings to String, it is both shorter
  and faster than the usual strlen/xstrndup combo, which calls strlen twice.
  cstr_to_string internally calls strlen and then xmemdupz.
Merge #783 'Nul terminate pascal strings'
deleted unused defines in vim.h  #772
Prevent null-pointer deference during vim_eval  #785

If the eval_expr call in vim_eval returns NULL, a null-pointer deference
would happen a few frames down, in vim_to_object_rec
Add function attributes to functions in memory.h  #811

Add missing function attributes in memory.h. Fixes #806
Declare garray iterators in the for() scope where possible #819
spelling fixes