The F-35 can see and shoot down the F-16 with radar-guided missiles in BVR well before the latter is even aware the F-35 is in the area.
Dogfighting is minimally relevant to modern air combat for nuclear-armed nations. Things would have to be going extraordinarily badly in a war for the brass to start deciding to send their exceedingly expensive fifth-gen stealth fighters into dogfight coin tosses.
Hell, even an A-10 is a surprisingly effective dogfighter against modern fighters. The fighters have speed but the Warthog has an extremely tight turning radius and far better low-speed maneuverability, both of which allow it to stay inside the opponent’s “bubble” (the area inside which a turning jet can’t ever manage to point its nose). If the A-10 can keep it to a one-circle fight it will win handily. A fighter will often have to rely on a “boom and zoom” tactic (where it disengages, gains distance, and turns back around for a guns pass) but that can be quite low probability of kill and still be relatively risky if the A-10 has friendlies in the area feeling it location information.
But just like the situation already being discussed, this is for all practical purposes completely irrelevant. A flight of F-16s would engage and destroy a flight of A-10s from miles away with AMRAAMs and it would never have a chance to transition to an up-close dogfight.
what's stopping the f-16 from turning around and going cold as soon as it hears a lock or senses enemy radar?
Either way, if the enemy turns and flees, from your perspective you’ve won the engagement. Whatever their purpose in the area was (SEAD, strike, air superiority, etc.) has been subverted.