Python/C++ numerical differences in erode function. Bug?

not necessarily. especially not with numpy. numpy is very good at sharing views. numpy is even more capable of handling views than cv::Mat is.