It honestly depends on the context of the situation. There isn't a universal standard because it all depends on what knowledge you have, where the situation is occurring and what what the circumstances may be. The Torah is extremely specific regarding a situation where the laws may be broken. This is usually only ever done during a situation where you face physically harming yourself or another.
Pikuach nefesh is the standard by which we honor Torah. We do not honor Torah if it means that we are going to harm ourselves or harm another.
Example, you wouldn't eat Kosher food over non-Kosher food if you were certain that the Kosher food was contaminated with E-Coli. The act of eating tainted food is equal to drinking poison. Thus it's declared "Pikuach nefesh"
We see this concept mentioned twice in Torah and discussed in the commentaries.
You shall keep My laws and My rules, by the pursuit of which man shall live: I am the LORD.
-Leviticus 18:5
I gave them My laws and taught them My rules, by the pursuit of which a man shall live.
-Ezekiel 20:11
To answer your specific questions:
Let's say a Jew travels on a long transatlantic flight. There are no food options except the on-board menu and non of them are kosher-certified. In this situation is it okay to choose a safer option (e.g. vegan or vegetarian)? Or should a Jew then abstain from eating for the duration of the flight?
Unless you have a medical condition which would make fasting dangerous (hypoglycemia for example) then you would abstain from eating. Fasting is not unusual from the Jewish perspective as we practice ritual fasting in religious practice. To go without food is not considered a form of self-harm unless you have a medical condition or the time which you are going without food is long enough to be harmful.
Vegetarian does not mean Kosher. The Vegetarian option would possibly include dairy which doesn't come from Kosher sources. This means that it wouldn't be considered the "safe" choice.
Even the vegan option would be questionable depending upon the circumstances of the preparation. The Kosher certification of a food product doesn't just gaurantee that the product was made with Kosher ingredients. The standard means that the product was made in a factory which separates meat and dairy.
If I eat a mixed green vegan salad from a service which also sells salads dairy and meat (BLT salad for example) then the salad could have possibly been prepared under unclean circumstances. The salad might very well be clean but the fact that we don't know means we are treading on breaking dietary law.
With regards to specific Talmudic discussions on the breaking of dietary laws, you can find them below.
-Yoma 83:a:2
A similar situation could occur with purchasing food in a country where no kosher options are available - would it be okay to buy milk and vegetables from a non-Jewish supermarket?
- You are responsible for doing research for the area which you visit. If you knew you were traveling to a country, you need to be aware of their dietary laws and prepare accordingly.
- You would only be allowed to eat foods which supercede dietary guidelines. This being mostly vegetables. The dairy options from those countries would not be allowed and since you have options which you know for certain would not break dietary laws, you would be forced to choose those.
- Even if you do choose vegetables over dairy, you still have to make sure your cooking situation meets standards. You would need to make sure that you're not cooking with utensils which haven't been cross contaminated with diary/meat. Your cooking surfaces would also need to be sterilized and/or covered with tin foil to prevent contamination. This way, even if the surface did touch meat/dairy before you were cooking there, there is no chance of mixing occurring.
Chabad has a detailed explanation of what goes into maintaining a Kosher kitchen. These are some of the standards you would need to maintain within this place you traveled.
Even if they don't offer kosher options, keeping kosher is still possible. The responsibility is on us to make that happen.