I stumbled on bug in snappy_ndvi.py file that is shown in "How to use the SNAP API from Python " step "Using the SNAP Java API from Python". Original file gave me overflow error. It seems that in some point default Numpy int type changed from int32 to int64.
The solution is to edit line 67. Originally it is like this:
ndviFlagsBand.writePixels(0, y, width, 1, ndviFlags)
ndviFlagsBand.writePixels(0, y, width, 1, ndviFlags.astype(numpy.int32))
My system is Ubuntu 16.04.3 LTS, Python 3.5.2, numpy 1.13.1, SNAP 5.