According to Wikipedia (based on information from Lambda Legal) about a third (~18) of US states will amend or change a birth certificate without surgery. This means, at the very least, that visitors from any of these states can legally use the ladies' in NC even if they still have a penis. Thus HB2 is inconsistent and therefore ineffective in accomplishing what it was intended to do (which - let's not fool ourselves - was never about 'protecting women and children', but simply about keeping people with penises out of the women's washroom on the assumption that any such person was obviously a 'man').
Until all washrooms are gender-neutral, there will be no consistent method of legally deciding who gets to use which one without reverting nationally to an immutable as-designated-at-birth-by-some-doctor-with-an-opinion. There is no method that can consistently identify someone as biologically 'male' or 'female' without making certain assumptions about what it means to be one or the other because sex is not an absolute binary, and to attempt to do so will require identity documents and enforcement by bathroom police and will still allow (even require) some people who may look like one to use the facilities of the other. For these reasons, I think we have to fall back on some combination of self-identification and presentation, which largely leaves it up to the individual's choice.