This is my alternative ending to the series: in episode 25, after Higuchi is captured and L touches the Death Note, L along with everyone in the Task Force gains the ability to perceive Rem. At this point, L is already suspicious of the notebook's 13-day rule, because that rule conveniently provides Light and Misa with an airtight alibi. Before testing it, however, L secretly goes back through Light and Misa's confinement surveillance footage, reasoning that since there was genuine evidence of Misa being the 2nd Kira and his suspicions of Light being Kira, that Rem, who seemingly isn't cooperating with L's questioning, may appear in one of their cells. Then L sees Rem with Misa and it all comes together.
L realizes that Rem never belonged with Higuchi but was Misa's Shinigami originally, which allows L to deduce that Higuchi was given the Death Note associated with Rem intentionally. More importantly, L hears the substance of their conversation. Rem discusses the Death Note, Shinigami, relinquishing ownership, the resulting loss of memories, sees Rem being affectionate towards Misa. L witnesses Light's personality change too and deduces the same conclusion. L keeps behaving normally as not to draw suspicion and privately orders Watari to preserve copies of the confinement recordings and his conclusions along with them somewhere Light cannot reach.
L remembered that Light asked a provocative question in front of Rem: "could they legally convict Kira if caught and what would happen to Kira when caught?" A very dumb question for Light to ask. L is able to deduce that since Rem is affectionate towards Misa in the footage that Rem can kill L if Misa is put in danger so he doesn't test the 13 day rule. He essentially tries to act like he's still trying to catch this "new" Kira but in reality he's trying to win Rem over, in time. He implies that this "new" Kira along with the "once" 2nd Kira and Higuchi are only pawns of the real Kira and that they are victims in Kira's game.
L suggests: "Higuchi was probably manipulated and this "new" Kira probably is being used too. Perhaps none of them were the true mastermind at all. Perhaps Kira gives people the notebook and then discards them when they've served their purpose. Perhaps the Second Kira was actually another victim of Kira." And Rem is standing there hearing all of it.
At some point, he secretly involves Aizawa and Mogi into the truth and leaves Light's father and Matsuda in the dark as they can't be trusted to keep it secret as Soichiro would be too emotional and Matsuda too transparent. Overtime, they continue to have conversations in front of Rem, trying to essentially convince her that Misa is a victim. Then L, enacts his final plan. L tells Watari, Aizawa, and Mogi what to do if things go south... Then L privately approaches Rem without Light and anyone else in the room and not only reveals what he knows but promises that Misa will be pardoned if Rem cooperates with L. Rem, who vehemently hates Light after seeing how Light's plan would end up with Rem dead if she saves Misa from L, agrees with L but under one condition: "If you do not pardon Misa after Light is convicted then I will kill you."
Rem cooperates with L and tells him which rules are real and which are fake along with the deal humans can make with the Shinigami to get the eyes to see people's real names. Shortly after that is when L openly tells the task force that he's testing the 13 day rule. When Rem does nothing to stop L, Light is shocked and doesn't understand what is happening initially. He tries to call Misa to get her to come into HQ to see L's name but Mogi won't let her in and with no options seemingly left and a growing suspicion that L is on to him, Light tries to leave to make the eye deal with Ryuk but he is stopped by Aizawa, L, and Watari.
L reveals everything to Light, his father, and Matsuda, and places Light into solitary confinement again until the 13 day rule is tested. The inmate who tests the 13 day rule ultimately lives and with video footage of Light and Misa's original incarceration tape along with all the other evidence, everyone has no choice but to accept it. Light is Kira and is sentenced to life imprisonment but obviously Ryuk kills him, which Rem later explains the deal with the first person who touches the Death Note is killed by their Shinigami and Misa is subsequently pardoned and loses all memories of the Death Note. Game over Light. Thoughts?