You have to detrend the signal. If you have a DC component the behauviour changes completely.
t = np.arange(0,0.1,dt)
x = (1+np.cos(2*np.pi*50*t))*np.cos(2*np.pi*1000*t)
This is because hilbert(x) returns de analytical function xr(t)+jxh(t), where xh is the Hilbert's Transform and xr is x(t), the original signal. xh is the same for x(t) than for x'=x(t)+k (Hilbert's transform of a constant is zero).
So, when you are calculating the envelope as abs(hilbert(xr)) what you get sqrt(xr^2+xh^2). If you use x'=x(t)+k you get sqrt((xr+k)^2+xh^2).
In Matlab, the envelope() function substracts the mean before applying hibert(). If you use abs(hilbert()) you should obtain the same result than with Python.
PD: After writting this I download your signal and I test the abs(hilbert()) on it. In Python I obtain the envelope...