Things you can try:

net_client_steamdatagram_enable_override 0

This forces direct UDP routing instead of Steam relay routing on some servers. For many players this fixes the “random high ping until reconnect” issue.

If it causes problems, revert:

net_client_steamdatagram_enable_override 1

Also try:

mm_session_search_qos_timeout 3

Some players say it reduces bad route selection.

Another useful thing:
When you join with high ping, type:

status

Then reconnect when it becomes 20 ms and type:

status