I use emacs and generally leave visibility for dangling whitespace enabled (it is a default). Most editors for programming will have an option to show control codes.
I suspect the problem here is that Grbl suspends acceleration calculation each time it encounters a speed setting command. Try your pyCAM code, but remove all but the first speed setting command.
I don’t think it’s a grbl thing as the issues are not present with other senders.
Might be something in how Carbide Motion sends the commands to the machine then.