Where have you been Jan? In a cave? ;-)
Sorry it couldn't resist.
As I understand, when you call mxGetPr and mxGetPi, the data is copied to ensure the compatibility. Yes it will not optimal, but it's not very inefficient either.
Yes, to avoid the data copy you have to compile MCC using -R2018a flag then use function such as mxGetDoubles, etc rather than mxGetPr
You can always use the predefined symbol MX_HAS_INTERLEAVED_COMPLEX to know which option you compile
a = mxGetDoubles(A);
ar = mxGetPr(A);
ai = mxGetPi(A);