patch 9.0.1913: if_python: undefined behaviour for function pointers

Problem:  if_python: undefined behaviour for function pointers
Solution: Fix if_python undefined behavior for function pointer casts

Identified by clang 17 UBSAN (see #12745). Make sure to cast function
pointers with the same signature only.

closes: #13122

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
diff --git a/src/if_python3.c b/src/if_python3.c
index c6d1acc..d2ffada 100644
--- a/src/if_python3.c
+++ b/src/if_python3.c
@@ -1425,7 +1425,7 @@
 	    p_pyx = 3;
 
 	DoPyCommand(script == NULL ? (char *) eap->arg : (char *) script,
-		(rangeinitializer) init_range_cmd,
+		init_range_cmd,
 		(runner) run_cmd,
 		(void *) eap);
     }
@@ -1491,7 +1491,7 @@
 
     // Execute the file
     DoPyCommand(buffer,
-	    (rangeinitializer) init_range_cmd,
+	    init_range_cmd,
 	    (runner) run_cmd,
 	    (void *) eap);
 }
@@ -1503,7 +1503,7 @@
 	p_pyx = 3;
 
     DoPyCommand((char *)eap->arg,
-	    (rangeinitializer)init_range_cmd,
+	    init_range_cmd,
 	    (runner)run_do,
 	    (void *)eap);
 }
@@ -2053,7 +2053,7 @@
 do_py3eval(char_u *str, typval_T *rettv)
 {
     DoPyCommand((char *) str,
-	    (rangeinitializer) init_range_eval,
+	    init_range_eval,
 	    (runner) run_eval,
 	    (void *) rettv);
     if (rettv->v_type == VAR_UNKNOWN)