It is tourist friendly and I have always found it safe.
With obvious precautions that a tourist needs to take almost everywhere. There is nothing inherently unsafe about it. Here is an excellent advisory:
British nationals made over 1.7 million visits to Turkey in 2016. Most visits are trouble free. Be alert to your surroundings and remain vigilant in crowded places popular with foreign nationals, including during festival periods.
The situation has calmed following an attempted coup on 15 to 16 July 2016. But the security environment remains potentially volatile and a state of emergency is in place. See Political Situation
In some busy areas, especially Istanbul, the Turkish authorities are stopping members of the public to conduct ID checks. There’s also a larger than usual number of police checkpoints on main roads across Turkey. You should co-operate with officials conducting checks, and keep your passport and a printed copy of your e-visa or your residence permit with you at all times.
To start: is it safe to visit Istanbul at the moment? Is the city tourist-friendly?
Yes it is, I have never felt threatened/scared or in danger in Istanbul.
2nd: Between July and September, when's the best time?
Not much to separate in that short period but July might be a little too hot.
3rd: Any advice?
Don't miss the Dondurma guys!