Sorry to be so hopeless, but now I have this signature:
(void)webView:(WKWebView )webView runJavaScriptTextInputPanelWithPrompt:(NSString )prompt defaultText:(NSString )defaultText initiatedByFrame:(WKFrameInfo )frame completionHandler:(void (^)(NSString *result))completionHandler;
Thus I should call the block with a pointer to an NSString as an argument. How do I get one from the Python string I have at hand, and what should I have as the ctypes argument - probably c_void_p?