Blender + ctypes = segmentation fault
You also need to specify the arg types, e.g.

cpp.KBlenderTest_get_val.argtypes = (ctp.c_void_p,)


otherwise I think they default to int, which is the wrong size for a pointer on 64-bit architectures.

Also, I would recommend opening the .so file with its full name including version number, e.g.

cpp = ctp.cdll.LoadLibrary("path_to_shared_lib/libblTest.so.1")


This is because it is usual to increment the version suffix if/when the ABI changes in some backward-incompatible way, so you want to make sure you stay with the right version, at least until your Python wrapper gets updated to the newer version in future.