Can I take logarithms of magnitudes (which are already log)
You can, the question is whether you should.

Is there a theoretical reason why you think that magnitude should vary exponentially with redshift? If not then you may be falling into a fallacy.

You see with a polynomial with sufficiently many terms, I can get a curve that fits your data perfectly, r=1, Does this my polynomial is a better model? Probably not.  Just throwing functions at your data and choosing the one that gives the biggest r isn't mathematical modelling of data.

I would question why you are using magnitude at all? You seem to be finding that "close objects appear brighter" which isn't a new discovery.