How to perform prediction on a mixed type label (i.e. continuous but optional)

I have a set of simulations in which an event may or may not happen. I recorded the time the event occurs and whether it does.

I would like to perform regression on the time variable, including whether the event happens at all. I suppose the easiest approach is to encode the missing value as NaN, but that opens a can of worms.

I imagine Linear Regression is out of the question, because there is no way it could generate a NaN.

I suppose a Decision Tree would also not work, because when establishing the value of a leaf it would calculate the average, which would be NaN if even one of the values is a NaN. Similar deal with Random Forests.

Question: are there techniques to deal with this situation? In particular, I am using Python.

No matter how you structure the problem, you have to have a numerical representation of the NaN (no occurrence of the event). Regression is a lot harder problem by default and thus having a value such as 0 to encode the NaN may be tough to address (and it doesn't make much sense, either). What I would do is treat the problem as both classification (a binary classifier to determine whether the event occurs or not) and regression (if it occurs, what is the value).