Rasterize a vector layer of the world continents to match the ERA5 grid.
Either with this python Notebook, saving the result as a NETCDF file.
Or with this Julia script, saving the result as a Zarr data cube. This approach still requires python to download some data from the Copernicus Data Store.