Improving my profile for cs phd admissions (math undergrad)
As far as marks and grades go, that will depend very much on where you apply. Checking the admission requirements for the 'top 50' PhD programs is the best advice I could give there. I'm assuming you're US based given you're referencing GPA, midterms etc, and providing you want to remain in the country looking up admission requirements should be then straightforward (the same would apply in any country with regard to undergrad marks and PhD admission expectations).

As you're intending on moving to computer science, the most important thing to have would be programming experience. Some of the 'exposure so far' that you detail might imply you have done actual coding, but it is not clear. You should definitely explicitly highlight what experience you have there on any application you make (and it would help if you did the same here!) If you are a competent mathematician (or scientist, or engineer for that matter) making the move to computer science should be well within your capabilities but it will, again, depend very much on where you apply as to how much foreknowledge they will expect / require you to have. I myself moved from chemistry research to being a C++ computer game engine programmer and I know plenty of programmers who have started out with degrees / careers in maths, engineering etc before ending up in computer science masters programs. Switching straight into a PhD may have more stringent requirements, but that'd be another thing to check on with the particular places you want to apply to.

There are no professional or academic repercussions as such to carrying out doctoral research in the same place you studied for your undergrad degree. However, moving elsewhere will most likely expose you to new ways of thinking and working, which is generally a good thing where research is concerned!