Do you know an exact "optimum" PH level for the stomach and intestines?
Both vary. Stomach pH changes between an empty stomach and when food is present and also depending on what foods are present. For example, a high protein meal will result in more stomach acid production as the protein digestive enzyme pepsin requires sufficient acidity to work. Before digestion starts the pH of the stomach will be around 4-5. During digestion the pH of the stomach can drop down as low as a pH of 1.
Intestinal pH also varies. The first part of the intestine, the duodenum, is kept around a pH of 6-7. Acids from the stomach can lower the pH temporarily, but the bicarbonate from the pancreas quickly brings the pH back up. The rest of the small intestine will have a pH range of 7-8. The colon has a pH around 5.5-7. If the colon starts becoming too acidic the pH is again adjusted by the release of bicarbonate.
And can you urine PH and saliva PH give any clues as to what stomach / gut PH may be?
No. These do not reflect blood pH either.
Is there any home test to get an idea for stomach / gut PH?
None that I am aware of and I doubt if there would be any. The only way to tell the pH of most of these areas is by accessing those areas, which cannot be done home.
Also is it true some bacteria can be attracted to more alkaline PH - whereas other bacteria can be attracted to more acid PH?
Most pathogenic bacteria are killed or controlled by an acidic environment. This is one of the reasons that so many parts of the body are slightly to highly acidic such as the skin and stomach. This helps to control pathogens. Most of the beneficial bacteria thrive in a slightly acidic environment.
I read h pylori is initally attracted to acidic gut but can live in it so burrows in mucosal layer and uses ammonia to survive.
Yes. H. pylori is sensitive to stomach acid so it secretes the ammonia to neutralize the stomach acid.