Would it ever be possible to make a synthetic hydrocarbon that wouldn't produce harmful by products.
Yes. If the hydrocarbon easily gave up hydrogen and the hydrogen were used to power a fuel cell, no 'harmful' byproducts would be produced. It would be an advantage to be able to recycle the hydrocarbon and reduce it back to the original hydrocarbon.
If the hydrocarbon is simply burned, CO2, CO, aldehydes, NOx compounds, etc. can be produced depending on the equipment used.
usually when a pure hydrocarbon is burned you release CO and H2O if you inject pure O2 into the reaction like oxy-acetaline torches
When you burn a hydrocarbon, you get water and carbon dioxide if your combustion is complete and your fuel is pure. Thermodynamically, carbon dioxide is a desirable combustion product.
Unfortunately, the most common method of doing that, steam reforming of methane, still produces carbon dioxide and/or monoxide. If you can find a way to generate hydrogen while producing only, say, solid carbon, you will become very rich...
If you use atmosphere as the source of oxygen, you can also produce NOx compounds... especially in systems that are designed to completely combust hydrocarbon to CO2 (lean burn systems).
Separate names with a comma.