If you need very low current on the HV side, you can use a MOSFET to shortcut a small transformer during one half wave of the mains. This circuit consumes around 11 mW on the mains side, I think it will also work with 10 Mohm -> 5.3 mW.
On the secondary side of the small transformer you can feed it with a high frequency. The voltage at the secondary side is only present at the negative half wave of the mains (M1 not conducting).
A simple BJT can rectify this, and provide a (more or less) square wave signal of the mains frequency at its collector. The duty cycle is not 50 %, so this does not give exact zero crossing marks at the edges. For this feature a full bridge rectifier on the input side and some other modifications are required.
The high frequency can be almost anything created by a MCU pin, as long as the small transformer's inductance is high enough to leave at least 1 VAC for the BJT drive at open primary side.
The body diode of the MOSFET is a load during negative half wave, but the remaining amplitude on the secondary side is high enough.
There are well isolated small 1:1 transformers in the range of 20-100 uH.
Sometimes it is possible to omit C3 and D2, directly driving the base with the transformer.

simulate this circuit – Schematic created using CircuitLab
An alternative circuit using a D-flipflop worked for me as well:

simulate this circuit
Short positive clock pulses trigger the flipflop, R1 and C1 introduce a little delay and define the sampling point.
If SW1 is open, the voltage at the secondary side winding can rise and the flipflop reads high.
If the transformer is shorted, the flipflop reads low.
R3 and D1 protect the D input on the falling clock edge.
The selected values work for a 1 mH transformer, a lower value for R2 may be needed for lower inductance coils.