There are plenty of ways to shorten one's lifespan. It can be through obvious means like putting oneself in danger, eating unhealthily, and poor lifestyle choices in general. Then, there are the ways that people don't really think about; people do all sorts of physically taxing and mentally stressful things in their lives that can shorten their life expectancy. Then, there are the totally out-there ways of shaving years off of one's life that can really only happen in works of fiction. This is where One Piece's Monkey D.Luffy comes into the picture.
The sad thing is that Luffy, for how much youthful vitality he shows, might not have all that long to live. It's not just about him constantly making enemies out of dangerous opponents or anything like that. The boy has put himself through all sorts of physically straining experiences that will probably take a toll on him in the long run. Rubber Pirate or not, Luffy is putting his body through far too much to be expected to live a long life.
One of the first big things Luffy has done to shorten his lifespan is used Second Gear. The technique involved him pumping blood through his body at an accelerated rate in order to give himself a boost in speed and power. Rob Lucci was quick to point out the issue with this technique; pumping blood through the heart and the rest of one's circulatory system like this was a good way to destroy it. Even as a rubber man, Luffy was undoubtedly creating this kind of lasting damage to himself from within.
What Lucci was describing is a real-life phenomenon. When the heart becomes enlarged due to high blood pressure, it can lead to all sorts of fatal conditions like cardiomyopathy and cardiac hypertrophy, which can ultimately result in heart failure. By forcing blood through his body, Luffy was inadvertently stretching out his heart muscles and making it more difficult to pump blood normally.
Gear Second's life-shortening side effect is made worse by how often Luffy relies on the technique. In occasional, short bursts, his rubber body should be able to keep up with the strain. However, the longer he fights and the more often he uses it, the more likely he is to pave the road for heart problems later in life.
Another lifespan-costing experience took place while Luffy was in Impel Down. In order to save the Straw Hat Pirate from the warden Magellan's venom, Emporio Ivankov used their Devil Fruit powers to alter the hormones in the boy's body to strengthen his immune system. The process was excruciating, lasted for hours, and ultimately took approximately 10 years off of Luffy's life expectancy. He only survived the ordeal is because of his indomitable will to live.
Both of these points and a few more are put forth by Quora commenter Tevin Davis. They also implied that Luffy's Third and Fourth Gears put a similar tax on his life, though this isn't explicitly stated in the narrative. Tevin believed that Luffy will die at a young age like his idol Gol D. Roger.
Other commenters on Quora have their own responses to this theory. One mentioned that Roger died at 53, so even if Luffy dies young, fans will still get plenty out of him. In this same vein, some believe Luffy's early death will either be saved for an end-of-series epilogue or not come up in the story at all.
Some predicted that Trafalgar Law will use his Op-Op Fruit's powers to perform the Perpetual Youth Surgery on Luffy to save his life. One commenter even envisioned this surgery making Luffy into "the immortal Sun God, sailing the seas forever, always seeking new adventures and new tyrants to stop on an eternal quest to prevent another world government from ever rising again." This is loosely based on the rumor of Nika the Sun God mentioned by Who's-Who. If this one ended up being true, it would have to be saved for the end of the series once all of One Piece's central conflicts are resolved. Otherwise, all tension from the story could be removed by making the protagonist immortal.
Whether it happens during or after the series, Luffy's early death seems all but guaranteed. However, this shouldn't be seen as such a bad thing; Luffy has had enough adventures and experiences to last multiple lifetimes and he's still got plenty more to go. He hasn't even found the One Piece yet. If he died having lived his life so short and sweet, he shouldn't have any regrets when he passes on.