Several ideas come to mind but they would all have to be researched to see if they would work in the environment you have and to what accuracy and repeatability. Temperature, light dispersion, TDT timing, capacitance, maybe conductivity.
The environment of a 'passive' dipstick gurantees it will get covered in oil during operation. The viscosity of the oil and how long it takes to drain from the non-wetted portion of the dipstick will determine how soon you can get a reliable reading after the engine stops. There is a reason mechanical dipsticks must be taken out, wiped, inserted, removed, and inspected to get a valid reading. You could certainly add mechanical motion to deal with those issues, depends on how fancy you want to get.
Is this for commercial, scholastic, or personal use?