Lightroom does indeed modify the image metadata directly in the file, which does change the dates, as you note. There is no setting to cause this to not happen for jpegs, only native raw files, as you've already noted. Lightroom does not change the pixel data for the image until you export a new version however. Each image has a "signature" for the pixel data, and it remains unchanged when changing ratings. I used ImageMagick's command line tool to verify this with an image.
Here's a diff between the image's info from ImageMagick's identify -verbose
command, for an image before rating and after:
77c77
< Orientation: Undefined
---
> Orientation: TopLeft
79,80c79,80
< Profile-8bim: 19234 bytes
< Profile-exif: 19975 bytes
---
> Profile-8bim: 19270 bytes
> Profile-exif: 20144 bytes
82c82,83
< Profile-iptc: 43 bytes
---
> Profile-iptc: 80 bytes
> City[1,90]: 0x00000000: 254700 -%G
83a85,86
> Created Date[2,55]: 20091227
> Created Time[2,60]: 204632-0800
86c89
< Profile-xmp: 9827 bytes
---
> Profile-xmp: 4732 bytes
88,89c91,92
< date:create: 2021-12-23T19:04:52+00:00
< date:modify: 2021-12-23T19:04:52+00:00
---
> date:create: 2021-12-23T19:41:12+00:00
> date:modify: 2021-12-23T19:41:12+00:00
127c130
< exif:Software: Ver.1.00
---
> exif:Software: Adobe Photoshop Lightroom 3.3
130,131c133
< exif:SubSecTimeDigitized: 40
< exif:SubSecTimeOriginal: 40
---
> exif:SubSecTimeDigitized: 4
149c151
< Filesize: 817263B
---
> Filesize: 812373B
151,153c153,155
< Pixels per second: 88.9319MP
< User time: 0.050u
< Elapsed time: 0:01.046
---
> Pixels per second: 98456800P
> User time: 0.040u
> Elapsed time: 0:01.042
Note the updated date:create:
and date:modify:
fields.
The "signature" remains unchanged:
signature: 99267d06117018d30ade29df7727625b99175ab867f9ef37e97e0cd53ec7cfe6