This sort of thing happens a lot in survey data. Question 1: Are you married. Question 2: If you answered yes to question 1, how long have you been married? I feel your pain.
I usually go with option 3: I code a binary for yes/no bit and then a continuous variable for the "how long have you been married" bit. Note that the continuous part of option 3 is the same as option 2. Option 1 involves "making the data up", which I try not to do.
First, I analyse the full data set with just the binary variable and hope that this gives me something useful. At a minimum, it's a good filter. If marital status does not affect the outcome, then length of marriage may not affect it either. Problem solved.
If I'm interested in "length of marriage", I'm going to select out those cases that are married and limit my analysis to them. If I believe that "length of marriage" affects my response, and I'm interested in studying that issue, unmarried people really have no information to give me on that point. So I exclude them for that piece.
There is an option 4 that sometimes works, and that is to build an ordinal variable that combines both portions. Recode 1 for unmarried, 2 for married for less than five years; 3 for married for five years or more. Obviously, this only works when the "no" answer can be viewed as a lower bound to the "yes" case. This won't work, for example, if the questions were Q1, did you take Prof. Smith's machine learning course? Q2. If "Yes", rate it on a scale of 1 through 10.
There is a reason why machine learning algorithms collapse under the kind of data you describe. Basically, you are dealing with two different sample spaces -- one space for the unmarried people; one space for the married people, about whom we have additional information. So the structure of the problem is different for the two population groups. Statistical models assume one sample space, one sigma algebra, one probability measure per customer. You actually have two models going here, and I am not aware of any clean way to bridge that gap.