I've also used a Dell XPS 15 9570 for the past year and a half which I spent $2.6k on (similar to this https://amzn.to/33PA53x). Specs-wise it's awesome and blows the MBP out of the park particularly when you factor in the price. But I've had a lot of issues with it unfortunately, having to get it repaired twice, and then another couple times I've had the screen just start glitching and crashing, both times resolving it via reinstalling Windows (seems to have been problems with the drivers). Outside of that, the laptop itself is a bit thicker and heavier than a MBP, the battery life is pretty weak (4 hours maybe?), it gets very hot and the fans get really loud, and the Wifi card sucks. Although the 4k screen is beautiful with fantastic anti-reflection, I've found that I prefer the 16:10 aspect ratio of the LG Gram and MBP vs. the 16:9 of the Dell since the former feels way bigger and I find having a taller screen more convenient (eg. for coding).
Ultimately it comes down to your preferences. Do you prioritize having the best specs? Then between the two you should get a Dell XPS 15 or alternatively a Dell Precision 5540 (very similar to the XPS 15, but more geared towards 3D work). If on the other hand you value portability but love having a large screen, I highly recommend the LG Gram 17. I don't think there's ever been a 17" laptop as light and portable as this one.
Ever since I received my LG, I stopped using my Dell. Unless you're doing a ton of video editing, 3d graphics work, or gaming, you really don't need more than 16gb RAM and an i7 processor. For stuff like coding and browsing the web, I certainly don't notice any performance difference (haven't tested more intensive stuff yet).