Please forgive the simplicity of my question. I have only had basic science courses. Common sense seems to indicate that planetary orbits should be very close to circular, any perturbations having been eliminated over the ages. Could it be that the composition of the planet be influencing the pull of gravity to produce a different gravitational attraction due to its mass? I mean that if a planet were composed all of one substance, would the planetary orbit be perfectly circular? I think about earth having constantly shifting water and gasses and even solids that affect its own rotation. Might these shifts also affect the orbit of the planet around the sun, or does the total mass of the earth and moon together determine the orbit?
They are close to circular, although we might quibble about the meaning of "close". Except for Mercury, all planetary orbits have eccentricities below 0.1. That's close enough to a circle to actually pass for a circle at a superficial examination.
Check out these ellipses. The first one has an ecc. of 0.1. Looks like a circle, doesn't it? Even the second one (ecc = 0.2) kind of looks like a circle, too, if you don't examine it too long.
As for why they are not exactly circular, down to the last digit? There will always be perturbations that will squish perfect circles a little. Planets interact with each other, and pull each other off perfect circular orbits. It's very unlikely that in a complex system like ours you'll find highly circular planetary orbits.
But, again, the differences between the current planetary orbits and perfect circles are for the most part quite tiny, and you should think of them as "basically circles", unless you're an astronomer or a NASA engineer.
Comets, OTOH, those do tend to move on narrow elliptic orbits.
While this has been answered before, I'll touch on a few of your specific questions.
Common sense seems to indicate that planetary orbits should be very close to circular, any perturbations having been eliminated over the ages.
This seemed logical to a lot of people including some big brains throughout history like Aristotle, Ptolomy, even Copernicus and Kepler himself thought circles were neater than ellipses, but he couldn't deny that the carefully detailed planet charts and the mathematical calculations worked so much better with ellipses.
It wasn't until Newton that they knew why. Newton worked it out that ellipses are stable orbits, and in fact a circle is a type of ellipse with zero eccentricity. Somebody said once, and I'm repeating, setting a dial exactly at zero is very hard because you're always going to be off by a tiny fraction. Setting the dial between 0 and 1 is easy. That's why all orbits are ellipses.
Now when you say perturbations, that usually refers to a 3rd body in the system. For example, Earth-Sun, the Earth orbits the sun in an ellipse. If you have Earth and Venus orbiting the Sun, Venus and earth perturb each other's ellipse.
Could it be that the composition of the planet be influencing the pull of gravity to produce a different gravitational attraction due to its mass? I mean that if a planet were composed all of one substance, would the planetary orbit be perfectly circular?
Gravity does change a bit at different points in an orbit for the reasons you say, planets aren't uniform. The Moon is especially unbalanced for example so this is more apparent with orbits around the moon, but all planets have some degree of non uniform mass and that has some tiny effects but that's not the cause for ellipses though, in fact, non-uniform mass will slightly warp an elliptical orbit.
I think about earth having constantly shifting water and gasses and even solids that affect its own rotation. Might these shifts also affect the orbit of the planet around the sun, or does the total mass of the earth and moon together determine the orbit?
We think of water as sloshing around and causing drag cause that's our experience when we spin or move something with water in it, but that's not what happens in orbit. The Earth in orbit around the sun, for example, everything on the earth including the oceans are all falling around the sun together, so there's no "shifting" going on, in the sense that I think you mean. There are tidal bulges, but the effect of the tidal bulges on the shape of an orbit is pretty small. In fact, there's a curious side effect to tidal bulges, they tend to circularize orbits, over time. They actually have the opposite effect of what you suggest.
I tried to cover this at a basic science level. Corrections / clarifications welcome.