Pickling of objects of classes whose __new__ mandates the use of keyword-only arguments is supported with protocol 4 (using a new opcode NEWOBJ_EX). But it is possible to implement this feature with protocol 2+ (less efficiently than with NEWOBJ_EX). __new_ex__ is pickled as partial(cls.__new__, cls, *args, **kwargs). Pickled data is compatible with older Python releases up to 2.7 (issue5228).
Proposed patch adds support of __new__ with keyword arguments with protocols 2 and 3.

"Pickling of objects of classes whose __new__ mandates the use of keyword-only arguments is supported with protocol 4 (using a new opcode NEWOBJ_EX)."
Hum, can you please write a short example of such class which can only be pickled by the protocol 4 currently? Just for my information.
I understand that some objects cannot be serialized by pickle with protocol lower than 4, whereas your change makes possible to serialize them on Python 3, and it will be possible to deserialize them on Python 2 and Python 3.
If I understood correctly, the change makes sense.
I reviewed the patch, it looks good to me.

> Hum, can you please write a short example of such class which can only be pickled by the protocol 4 currently? Just for my information.
For now there are no such classes in the stdlib. No one implements __getnewargs_ex__. But an alternative implementation of pickling for methodcaller could use it (I implemented methodcaller pickling in issue22955 in different way, via __reduce_ex__, but used the same trick for passing keyword arguments to constructor).
Note that multiprocessing uses default protocol 3 (issue23403), and this is not configurable.

> New changeset 288953a787ce by Victor Stinner in branch 'default':
> Issue #24164: Fix test_pyclbr
Another fix would be to accept functools.partial type, but it looks like the test wants to exclude symbols which comes from other modules.