What are the alternatives (but not too formal or unnecessary polite) to "I was going to ask you" phrase to start conversation with the question?
There's nothing wrong with "I was going to ask you..." Some alternatives would be "I wanted to ask you..." or "I was meaning to ask you..." None of these sound too formal or unnecessarily polite, and they could be used in a wide variety of contexts (among friends, between an employee and boss, between a husband and wife, etc.)
Yet one more might be: "May I ask you a question?"
Besides previously-suggested formulas, consider the following. All of the following have about the same meanings, but depending on tone or content will have different nuances, as suggested in the comments after each.
Can you tell me if... (fairly neutral but may suggest information is restricted or person's knowledge limited)
Will you tell me if... (fairly neutral but may imply person is secretive)
Won't you tell me if... (sometimes used to ask for information as a favor)
Do you know if... –or– Do you know whether... (neutral, but some people may bridle at the implication they don't know something)
In many cases, these and the previously-suggested formulas are no more than conversational fillers; the direct approach of just asking the question you want to ask often is a better thing to do.