Proposed patch adds the const qualifier to char* parameter declarations and static char arrays if appropriate. This makes the code more strict and can help to catch bugs or generate more efficient code. In additional it can decrease memory consumption by avoiding copying constant data.
What is the point of changing the return value of a function in Objects/memoryobject.c to "const char *" and then casting it back to "char *" in the one place that the function is used? Churn like this has a direct cost for me: I have to update my private 100% coverage patch for no gain at all.
get_native_fmtstr() returns a pointer to C string literal. It is constant by its nature, and I thought it would be more clear to cast it explicitly if needed. It would be better (in particular for compatibility with C++) to make Py_buffer.format to be const char*, since it is borrowed reference to constant string, and often is initialized with string literal, but this is backward incompatible change of public API. I'm planning to open separate issue for backward-incompatible (controlled with a macro) constantness changing.
I was faced with the same dilemma when I wrote the code and I *deliberately* decided that returning (const char *) + an additional cast wasn't worth it for a static function that's used only once.
There's no need to revert it. Both versions are okay, but I wanted to point out that these kinds of changes a) add a cognitive load for other developers (I have to look what has changed in memoryobject.c) and b) may override other developers' conscious decisions.