Heat the oven to 325°F. Spread the shredded coconut on a baking sheet and toast for 6–9 minutes, stirring once, until just golden at the edges. Transfer to a plate to cool. Grease two 8-inch round pans, line the bottoms with parchment, and lightly grease the parchment as well.
Bloom the cocoa: In a heatproof bowl or large measuring cup, whisk the cocoa powder and espresso powder with the hot brewed coffee until smooth and glossy. Let stand 5 minutes to cool slightly.
In a large mixing bowl, whisk together flour, sugar, baking soda, baking powder, and salt until evenly combined.
In a separate bowl, whisk the eggs, oil, vanilla, coconut extract, and coconut milk until silky and homogeneous. Pour in the cocoa-coffee mixture and whisk to combine.
Add the dry ingredients to the wet mixture in two additions, whisking gently just until you no longer see dry flour. The batter will be thin.
Divide batter evenly between the prepared pans (about 550–600 g per pan if using a scale). Tap pans once or twice to release large bubbles.
Bake on the center rack for 28–34 minutes, until the centers spring back lightly and a tester comes out with a few moist crumbs. Cool in pans 10 minutes, then turn out onto a rack, peel away parchment, and cool completely. For tidier frosting, chill layers 20–30 minutes once cool.
Make the coconut buttercream: Beat the softened butter on medium-high for 2–3 minutes until pale and fluffy. Reduce speed to low and gradually add the powdered sugar, salt, and coconut extract. Drizzle in coconut milk, 1 tablespoon at a time, until creamy and spreadable. Beat 1 minute more on medium to aerate. Stir in coconut rum, if using.
Assemble: Place one cake layer on a stand. Lightly brush the top with 1–2 teaspoons coconut milk (optional), then spread about 3/4 cup buttercream evenly to the edges. Top with the second layer, bottom-side up for a flat surface.
Apply a thin crumb coat over the top and sides and chill for 10–15 minutes to set. Finish with a thicker, smooth coat of buttercream.
Press the toasted coconut generously onto the sides and sprinkle over the top, covering the cake well. Slice with a warm knife for clean edges and serve.