[Chapel Merge] Switch from size/codepoint check to isEmpty for me

Branch: refs/heads/main
Revision: 644d609
Author: ronawho
Log Message:

Merge pull request #18309 from ronawho/simpler-memtrack-check

Switch from size/codepoint check to isEmpty for memtracking strings

[reviewed by @e-kayrakli]

The mem tracking code checks if some config strings are set before
trying to copy locally and pass c_strings to the runtime. Previously,
this was done with a .size != 0 check, which will count codepoints.
Switch to just doing a isEmpty() check, which is faster.

I discovered this while looking for out-of-segment comm as part of
#18284. It turns out that because string consts are shallow copied the
internal locale_id is wrong, which led to numCodespoints doing an
on-statement and out-of-segment comm. I opened Cray/chapel-private#2472
to track this shallow copying of strings, but still thought it made
sense to use the quicker isEmpty check here anyways.

Modified Files:
M modules/internal/MemTracking.chpl

Compare: https://github.com/chapel-lang/chapel/compare/bf06bd5d4789...644d609c0a04