Speaking specifically of the Foreign Service of the US Department of State, I can through in a little insight from one of the security investigators. First of all, there are no medical questions until you are offered a position -- which can come after the written and orals, but even if you pass those, a job offer is not guaranteed. In some years because of the budget, there is simply no intake of new applicants. That is not a reflection on your personal qualifications, but the political mood in Congress. And many more people pass both exams than there are slots to fill. Less than one percent of the people who take the written exam are ever hired. And if you are not the child of a congressman, the odds against you increase. State if the most politicized of any part of the federal government.
Unlike other government agencies and departments, there is no poly in State. Your clearance is granted on the basis of your background investigation, starting at elementary school. And with your birth record, to demonstrate that you were not parachuted by the Russians into Nebraska some 25 years ago. If your friends and neighbors do not think you are weird, then you are not weird. And State is not nearly as close-minded as we might think it is. Open gays and lesbians are hired on an equal basis. There has been one FSO who transitioned MtF on the job while serving in an embassy overseas. But if you fall into one of those groups, expect no privacy. The PR people with trumpet you around the world as an example of how liberal an d open to gender diversity the USG is.
All that being said, the various legal protections, which are taken very seriously by the feds, to not apply until you have been offered a position, have accepted in writing, and sworn the oath. Given that there are gazillion qualified applicants for every position as an FSO, my advice would be not to volunteer any thoughts of gender dysphoria until one is already hired and "one of them." The FEHBP for State is also unique, and there is a firewall between your medical info you may wish to keep private and anyone in the Department. But if you do keep it a secret, then the Overseas Medical Benefits will not apply to your condition. (OMB are cost-free total expenses paid for anything that happens overseas, not a minor perk.)
So for advice? First, pass the exams, which you will not do if you apply the first year out of a four-year university. Deal with all that other stuff later.