I would create a new raster dataset with the oceans masked out. Assuming any cell with an elevation less than or equal to zero, I would do:
import numpy
import rasterio
with rasterio.open('path/to/orig.tif', 'r') as orig:
land_and_sea = orig.read(1)
meta_data = orig.meta.copy()
nodata_value = -9999
meta_data['nodata'] = nodata_value
with rasterio.open('/path/to/masked.tif', 'w', **meta_data) as masked:
land_only = numpy.where(land_and_sea > 0, land_and_sea, nodata_value)
masked.write(land_only, 1)
Then you'd repeat the process of generating the stream network.
Alternatively, you could create a polygon from the masked raster and clip the stream to that polygon.